/*
 * Copyright (C) 2007-2018 Siemens AG
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published
 * by the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
 */

/*******************************************************************
 *
 * @author Daniel.Peintner.EXT@siemens.com
 * @version 0.9.4 
 * @contact Richard.Kuntschke@siemens.com
 *
 * <p>Code generated by EXIdizer</p>
 * <p>Schema: V2G_CI_MsgDef.xsd</p>
 *
 *
 ********************************************************************/




#include "dinEXIDatatypesDecoder.h"

#include "DecoderChannel.h"
#include "EXIHeaderDecoder.h"

#include "dinEXIDatatypes.h"
#include "ErrorCodes.h"

#ifndef EXI_din_DATATYPES_DECODER_C
#define EXI_din_DATATYPES_DECODER_C

#if DEPLOY_DIN_CODEC == SUPPORT_YES

/** event-code */
static uint32_t eventCode;
static int errn;
static uint32_t uint32;

/* Forward Declarations */
static int decode_dinMeteringReceiptReqType(bitstream_t* stream, struct dinMeteringReceiptReqType* dinMeteringReceiptReqType);
static int decode_dinBodyType(bitstream_t* stream, struct dinBodyType* dinBodyType);
static int decode_dinSessionSetupReqType(bitstream_t* stream, struct dinSessionSetupReqType* dinSessionSetupReqType);
static int decode_dinPowerDeliveryResType(bitstream_t* stream, struct dinPowerDeliveryResType* dinPowerDeliveryResType);
static int decode_dinServiceDetailResType(bitstream_t* stream, struct dinServiceDetailResType* dinServiceDetailResType);
static int decode_dinWeldingDetectionResType(bitstream_t* stream, struct dinWeldingDetectionResType* dinWeldingDetectionResType);
static int decode_dinContractAuthenticationResType(bitstream_t* stream, struct dinContractAuthenticationResType* dinContractAuthenticationResType);
static int decode_dinCanonicalizationMethodType(bitstream_t* stream, struct dinCanonicalizationMethodType* dinCanonicalizationMethodType);
static int decode_dinSPKIDataType(bitstream_t* stream, struct dinSPKIDataType* dinSPKIDataType);
static int decode_dinListOfRootCertificateIDsType(bitstream_t* stream, struct dinListOfRootCertificateIDsType* dinListOfRootCertificateIDsType);
static int decode_dinSelectedServiceListType(bitstream_t* stream, struct dinSelectedServiceListType* dinSelectedServiceListType);
static int decode_dinCurrentDemandResType(bitstream_t* stream, struct dinCurrentDemandResType* dinCurrentDemandResType);
static int decode_dinTransformType(bitstream_t* stream, struct dinTransformType* dinTransformType);
static int decode_dinAC_EVChargeParameterType(bitstream_t* stream, struct dinAC_EVChargeParameterType* dinAC_EVChargeParameterType);
static int decode_dinX509DataType(bitstream_t* stream, struct dinX509DataType* dinX509DataType);
static int decode_dinChargingStatusResType(bitstream_t* stream, struct dinChargingStatusResType* dinChargingStatusResType);
static int decode_dinWeldingDetectionReqType(bitstream_t* stream, struct dinWeldingDetectionReqType* dinWeldingDetectionReqType);
static int decode_dinSignaturePropertiesType(bitstream_t* stream, struct dinSignaturePropertiesType* dinSignaturePropertiesType);
static int decode_dinContractAuthenticationReqType(bitstream_t* stream, struct dinContractAuthenticationReqType* dinContractAuthenticationReqType);
static int decode_dinDC_EVPowerDeliveryParameterType(bitstream_t* stream, struct dinDC_EVPowerDeliveryParameterType* dinDC_EVPowerDeliveryParameterType);
static int decode_dinEVSEChargeParameterType(bitstream_t* stream, struct dinEVSEChargeParameterType* dinEVSEChargeParameterType);
static int decode_dinCableCheckReqType(bitstream_t* stream, struct dinCableCheckReqType* dinCableCheckReqType);
static int decode_dinDC_EVChargeParameterType(bitstream_t* stream, struct dinDC_EVChargeParameterType* dinDC_EVChargeParameterType);
static int decode_dinSAScheduleListType(bitstream_t* stream, struct dinSAScheduleListType* dinSAScheduleListType);
static int decode_dinPMaxScheduleType(bitstream_t* stream, struct dinPMaxScheduleType* dinPMaxScheduleType);
static int decode_dinServicePaymentSelectionReqType(bitstream_t* stream, struct dinServicePaymentSelectionReqType* dinServicePaymentSelectionReqType);
static int decode_dinRelativeTimeIntervalType(bitstream_t* stream, struct dinRelativeTimeIntervalType* dinRelativeTimeIntervalType);
static int decode_dinEVStatusType(bitstream_t* stream, struct dinEVStatusType* dinEVStatusType);
static int decode_dinPreChargeResType(bitstream_t* stream, struct dinPreChargeResType* dinPreChargeResType);
static int decode_dinDC_EVSEChargeParameterType(bitstream_t* stream, struct dinDC_EVSEChargeParameterType* dinDC_EVSEChargeParameterType);
static int decode_dinPaymentDetailsResType(bitstream_t* stream, struct dinPaymentDetailsResType* dinPaymentDetailsResType);
static int decode_dinDSAKeyValueType(bitstream_t* stream, struct dinDSAKeyValueType* dinDSAKeyValueType);
static int decode_dinSASchedulesType(bitstream_t* stream, struct dinSASchedulesType* dinSASchedulesType);
static int decode_dinCertificateUpdateResType(bitstream_t* stream, struct dinCertificateUpdateResType* dinCertificateUpdateResType);
static int decode_dinEVChargeParameterType(bitstream_t* stream, struct dinEVChargeParameterType* dinEVChargeParameterType);
static int decode_dinMessageHeaderType(bitstream_t* stream, struct dinMessageHeaderType* dinMessageHeaderType);
static int decode_dinBodyBaseType(bitstream_t* stream, struct dinBodyBaseType* dinBodyBaseType);
static int decode_dinKeyValueType(bitstream_t* stream, struct dinKeyValueType* dinKeyValueType);
static int decode_dinIntervalType(bitstream_t* stream, struct dinIntervalType* dinIntervalType);
static int decode_dinChargeParameterDiscoveryResType(bitstream_t* stream, struct dinChargeParameterDiscoveryResType* dinChargeParameterDiscoveryResType);
static int decode_dinPowerDeliveryReqType(bitstream_t* stream, struct dinPowerDeliveryReqType* dinPowerDeliveryReqType);
static int decode_dinCertificateChainType(bitstream_t* stream, struct dinCertificateChainType* dinCertificateChainType);
static int decode_dinTransformsType(bitstream_t* stream, struct dinTransformsType* dinTransformsType);
static int decode_dinEntryType(bitstream_t* stream, struct dinEntryType* dinEntryType);
static int decode_dinSessionStopType(bitstream_t* stream, struct dinSessionStopType* dinSessionStopType);
static int decode_dinServiceDetailReqType(bitstream_t* stream, struct dinServiceDetailReqType* dinServiceDetailReqType);
static int decode_dinDigestMethodType(bitstream_t* stream, struct dinDigestMethodType* dinDigestMethodType);
static int decode_dinParameterType(bitstream_t* stream, struct dinParameterType* dinParameterType);
static int decode_dinChargingStatusReqType(bitstream_t* stream, struct dinChargingStatusReqType* dinChargingStatusReqType);
static int decode_dinSignatureMethodType(bitstream_t* stream, struct dinSignatureMethodType* dinSignatureMethodType);
static int decode_dinCertificateInstallationReqType(bitstream_t* stream, struct dinCertificateInstallationReqType* dinCertificateInstallationReqType);
static int decode_dinSalesTariffEntryType(bitstream_t* stream, struct dinSalesTariffEntryType* dinSalesTariffEntryType);
static int decode_dinServiceDiscoveryResType(bitstream_t* stream, struct dinServiceDiscoveryResType* dinServiceDiscoveryResType);
static int decode_dinParameterSetType(bitstream_t* stream, struct dinParameterSetType* dinParameterSetType);
static int decode_dinCurrentDemandReqType(bitstream_t* stream, struct dinCurrentDemandReqType* dinCurrentDemandReqType);
static int decode_dinPreChargeReqType(bitstream_t* stream, struct dinPreChargeReqType* dinPreChargeReqType);
static int decode_dinSignatureType(bitstream_t* stream, struct dinSignatureType* dinSignatureType);
static int decode_dinReferenceType(bitstream_t* stream, struct dinReferenceType* dinReferenceType);
static int decode_dinProfileEntryType(bitstream_t* stream, struct dinProfileEntryType* dinProfileEntryType);
static int decode_dinAnonType_V2G_Message(bitstream_t* stream, struct dinAnonType_V2G_Message* dinAnonType_V2G_Message);
static int decode_dinChargeParameterDiscoveryReqType(bitstream_t* stream, struct dinChargeParameterDiscoveryReqType* dinChargeParameterDiscoveryReqType);
static int decode_dinConsumptionCostType(bitstream_t* stream, struct dinConsumptionCostType* dinConsumptionCostType);
static int decode_dinRSAKeyValueType(bitstream_t* stream, struct dinRSAKeyValueType* dinRSAKeyValueType);
static int decode_dinServiceType(bitstream_t* stream, struct dinServiceType* dinServiceType);
static int decode_dinServiceTagListType(bitstream_t* stream, struct dinServiceTagListType* dinServiceTagListType);
static int decode_dinEVSEStatusType(bitstream_t* stream, struct dinEVSEStatusType* dinEVSEStatusType);
static int decode_dinSessionSetupResType(bitstream_t* stream, struct dinSessionSetupResType* dinSessionSetupResType);
static int decode_dinEVPowerDeliveryParameterType(bitstream_t* stream, struct dinEVPowerDeliveryParameterType* dinEVPowerDeliveryParameterType);
static int decode_dinX509IssuerSerialType(bitstream_t* stream, struct dinX509IssuerSerialType* dinX509IssuerSerialType);
static int decode_dinSelectedServiceType(bitstream_t* stream, struct dinSelectedServiceType* dinSelectedServiceType);
static int decode_dinMeteringReceiptResType(bitstream_t* stream, struct dinMeteringReceiptResType* dinMeteringReceiptResType);
static int decode_dinDC_EVStatusType(bitstream_t* stream, struct dinDC_EVStatusType* dinDC_EVStatusType);
static int decode_dinPhysicalValueType(bitstream_t* stream, struct dinPhysicalValueType* dinPhysicalValueType);
static int decode_dinManifestType(bitstream_t* stream, struct dinManifestType* dinManifestType);
static int decode_dinPMaxScheduleEntryType(bitstream_t* stream, struct dinPMaxScheduleEntryType* dinPMaxScheduleEntryType);
static int decode_dinServiceParameterListType(bitstream_t* stream, struct dinServiceParameterListType* dinServiceParameterListType);
static int decode_dinSignatureValueType(bitstream_t* stream, struct dinSignatureValueType* dinSignatureValueType);
static int decode_dinPaymentOptionsType(bitstream_t* stream, struct dinPaymentOptionsType* dinPaymentOptionsType);
static int decode_dinServiceTagType(bitstream_t* stream, struct dinServiceTagType* dinServiceTagType);
static int decode_dinAC_EVSEStatusType(bitstream_t* stream, struct dinAC_EVSEStatusType* dinAC_EVSEStatusType);
static int decode_dinCertificateUpdateReqType(bitstream_t* stream, struct dinCertificateUpdateReqType* dinCertificateUpdateReqType);
static int decode_dinServicePaymentSelectionResType(bitstream_t* stream, struct dinServicePaymentSelectionResType* dinServicePaymentSelectionResType);
static int decode_dinSAScheduleTupleType(bitstream_t* stream, struct dinSAScheduleTupleType* dinSAScheduleTupleType);
static int decode_dinChargingProfileType(bitstream_t* stream, struct dinChargingProfileType* dinChargingProfileType);
static int decode_dinServiceDiscoveryReqType(bitstream_t* stream, struct dinServiceDiscoveryReqType* dinServiceDiscoveryReqType);
static int decode_dinAC_EVSEChargeParameterType(bitstream_t* stream, struct dinAC_EVSEChargeParameterType* dinAC_EVSEChargeParameterType);
static int decode_dinKeyInfoType(bitstream_t* stream, struct dinKeyInfoType* dinKeyInfoType);
static int decode_dinPaymentDetailsReqType(bitstream_t* stream, struct dinPaymentDetailsReqType* dinPaymentDetailsReqType);
static int decode_dinCableCheckResType(bitstream_t* stream, struct dinCableCheckResType* dinCableCheckResType);
static int decode_dinObjectType(bitstream_t* stream, struct dinObjectType* dinObjectType);
static int decode_dinSessionStopResType(bitstream_t* stream, struct dinSessionStopResType* dinSessionStopResType);
static int decode_dinSignedInfoType(bitstream_t* stream, struct dinSignedInfoType* dinSignedInfoType);
static int decode_dinSalesTariffType(bitstream_t* stream, struct dinSalesTariffType* dinSalesTariffType);
static int decode_dinCostType(bitstream_t* stream, struct dinCostType* dinCostType);
static int decode_dinServiceChargeType(bitstream_t* stream, struct dinServiceChargeType* dinServiceChargeType);
static int decode_dinDC_EVSEStatusType(bitstream_t* stream, struct dinDC_EVSEStatusType* dinDC_EVSEStatusType);
static int decode_dinRetrievalMethodType(bitstream_t* stream, struct dinRetrievalMethodType* dinRetrievalMethodType);
static int decode_dinNotificationType(bitstream_t* stream, struct dinNotificationType* dinNotificationType);
static int decode_dinPGPDataType(bitstream_t* stream, struct dinPGPDataType* dinPGPDataType);
static int decode_dinCertificateInstallationResType(bitstream_t* stream, struct dinCertificateInstallationResType* dinCertificateInstallationResType);
static int decode_dinSignaturePropertyType(bitstream_t* stream, struct dinSignaturePropertyType* dinSignaturePropertyType);
static int decode_dinMeterInfoType(bitstream_t* stream, struct dinMeterInfoType* dinMeterInfoType);
static int decode_dinSubCertificatesType(bitstream_t* stream, struct dinSubCertificatesType* dinSubCertificatesType);

/* Deviant data decoding (skip functions) */


/* Complex type name='urn:iso:15118:2:2010:MsgBody,MeteringReceiptReqType',  base type name='BodyBaseType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("urn:iso:15118:2:2010:MsgBody":SessionID,"urn:iso:15118:2:2010:MsgBody":SAScheduleTupleID{0-1},"urn:iso:15118:2:2010:MsgBody":MeterInfo)',  derivedBy='EXTENSION'.  */
static int decode_dinMeteringReceiptReqType(bitstream_t* stream, struct dinMeteringReceiptReqType* dinMeteringReceiptReqType) {
	int grammarID = 0;
	int done = 0;
	
	init_dinMeteringReceiptReqType(dinMeteringReceiptReqType);
	
	while(!done) {
		switch(grammarID) {
		case 0:
			/* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionID)] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decodeUnsignedInteger16(stream, &dinMeteringReceiptReqType->Id.charactersLen);
					if (errn == 0) {
						if (dinMeteringReceiptReqType->Id.charactersLen >= 2) {
							dinMeteringReceiptReqType->Id.charactersLen = (uint16_t)(dinMeteringReceiptReqType->Id.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, dinMeteringReceiptReqType->Id.charactersLen, dinMeteringReceiptReqType->Id.characters, dinMeteringReceiptReqType_Id_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					dinMeteringReceiptReqType->Id_isUsed = 1u;
					grammarID = 1;
					break;
				case 1:
					/* FirstStartTag[CHARACTERS[BINARY_HEX]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger16(stream, &dinMeteringReceiptReqType->SessionID.bytesLen);
							if (errn == 0) {
								errn =  (dinMeteringReceiptReqType->SessionID.bytesLen) <= dinMeteringReceiptReqType_SessionID_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
							}
							if (errn == 0) {
								errn = decodeBytes(stream, dinMeteringReceiptReqType->SessionID.bytesLen, dinMeteringReceiptReqType->SessionID.bytes);
							}
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionID) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 2;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 1:
			/* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionID)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[BINARY_HEX]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger16(stream, &dinMeteringReceiptReqType->SessionID.bytesLen);
							if (errn == 0) {
								errn =  (dinMeteringReceiptReqType->SessionID.bytesLen) <= dinMeteringReceiptReqType_SessionID_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
							}
							if (errn == 0) {
								errn = decodeBytes(stream, dinMeteringReceiptReqType->SessionID.bytesLen, dinMeteringReceiptReqType->SessionID.bytes);
							}
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionID) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 2;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 2:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SAScheduleTupleID), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeterInfo)] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[INTEGER]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeInteger16(stream, &dinMeteringReceiptReqType->SAScheduleTupleID);
							dinMeteringReceiptReqType->SAScheduleTupleID_isUsed = 1u;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SAScheduleTupleID) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 3;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 1:
					errn = decode_dinMeterInfoType(stream, &dinMeteringReceiptReqType->MeterInfo);
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 3:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeterInfo)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinMeterInfoType(stream, &dinMeteringReceiptReqType->MeterInfo);
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 4:
			/* Element[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgDef,BodyType',  base type name='anyType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("urn:iso:15118:2:2010:MsgDef":BodyElement{0-1})',  derivedBy='RESTRICTION'.  */
static int decode_dinBodyType(bitstream_t* stream, struct dinBodyType* dinBodyType) {
	int grammarID = 6;
	int done = 0;
	
	init_dinBodyType(dinBodyType);
	
	while(!done) {
		switch(grammarID) {
		case 6:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDef}BodyElement), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CableCheckReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CableCheckRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateInstallationReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateInstallationRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateUpdateReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateUpdateRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargeParameterDiscoveryReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargeParameterDiscoveryRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingStatusReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingStatusRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractAuthenticationReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractAuthenticationRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CurrentDemandReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CurrentDemandRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeteringReceiptReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeteringReceiptRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PaymentDetailsReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PaymentDetailsRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PowerDeliveryReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PowerDeliveryRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PreChargeReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PreChargeRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDetailReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDetailRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDiscoveryReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDiscoveryRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServicePaymentSelectionReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServicePaymentSelectionRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionSetupReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionSetupRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionStopReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionStopRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}WeldingDetectionReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}WeldingDetectionRes), END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 6, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinBodyBaseType(stream, &dinBodyType->BodyElement);
					dinBodyType->BodyElement_isUsed = 1u;
					grammarID = 4;
					break;
				case 1:
					errn = decode_dinCableCheckReqType(stream, &dinBodyType->CableCheckReq);
					dinBodyType->CableCheckReq_isUsed = 1u;
					grammarID = 4;
					break;
				case 2:
					errn = decode_dinCableCheckResType(stream, &dinBodyType->CableCheckRes);
					dinBodyType->CableCheckRes_isUsed = 1u;
					grammarID = 4;
					break;
				case 3:
					errn = decode_dinCertificateInstallationReqType(stream, &dinBodyType->CertificateInstallationReq);
					dinBodyType->CertificateInstallationReq_isUsed = 1u;
					grammarID = 4;
					break;
				case 4:
					errn = decode_dinCertificateInstallationResType(stream, &dinBodyType->CertificateInstallationRes);
					dinBodyType->CertificateInstallationRes_isUsed = 1u;
					grammarID = 4;
					break;
				case 5:
					errn = decode_dinCertificateUpdateReqType(stream, &dinBodyType->CertificateUpdateReq);
					dinBodyType->CertificateUpdateReq_isUsed = 1u;
					grammarID = 4;
					break;
				case 6:
					errn = decode_dinCertificateUpdateResType(stream, &dinBodyType->CertificateUpdateRes);
					dinBodyType->CertificateUpdateRes_isUsed = 1u;
					grammarID = 4;
					break;
				case 7:
					errn = decode_dinChargeParameterDiscoveryReqType(stream, &dinBodyType->ChargeParameterDiscoveryReq);
					dinBodyType->ChargeParameterDiscoveryReq_isUsed = 1u;
					grammarID = 4;
					break;
				case 8:
					errn = decode_dinChargeParameterDiscoveryResType(stream, &dinBodyType->ChargeParameterDiscoveryRes);
					dinBodyType->ChargeParameterDiscoveryRes_isUsed = 1u;
					grammarID = 4;
					break;
				case 9:
					errn = decode_dinChargingStatusReqType(stream, &dinBodyType->ChargingStatusReq);
					dinBodyType->ChargingStatusReq_isUsed = 1u;
					grammarID = 4;
					break;
				case 10:
					errn = decode_dinChargingStatusResType(stream, &dinBodyType->ChargingStatusRes);
					dinBodyType->ChargingStatusRes_isUsed = 1u;
					grammarID = 4;
					break;
				case 11:
					errn = decode_dinContractAuthenticationReqType(stream, &dinBodyType->ContractAuthenticationReq);
					dinBodyType->ContractAuthenticationReq_isUsed = 1u;
					grammarID = 4;
					break;
				case 12:
					errn = decode_dinContractAuthenticationResType(stream, &dinBodyType->ContractAuthenticationRes);
					dinBodyType->ContractAuthenticationRes_isUsed = 1u;
					grammarID = 4;
					break;
				case 13:
					errn = decode_dinCurrentDemandReqType(stream, &dinBodyType->CurrentDemandReq);
					dinBodyType->CurrentDemandReq_isUsed = 1u;
					grammarID = 4;
					break;
				case 14:
					errn = decode_dinCurrentDemandResType(stream, &dinBodyType->CurrentDemandRes);
					dinBodyType->CurrentDemandRes_isUsed = 1u;
					grammarID = 4;
					break;
				case 15:
					errn = decode_dinMeteringReceiptReqType(stream, &dinBodyType->MeteringReceiptReq);
					dinBodyType->MeteringReceiptReq_isUsed = 1u;
					grammarID = 4;
					break;
				case 16:
					errn = decode_dinMeteringReceiptResType(stream, &dinBodyType->MeteringReceiptRes);
					dinBodyType->MeteringReceiptRes_isUsed = 1u;
					grammarID = 4;
					break;
				case 17:
					errn = decode_dinPaymentDetailsReqType(stream, &dinBodyType->PaymentDetailsReq);
					dinBodyType->PaymentDetailsReq_isUsed = 1u;
					grammarID = 4;
					break;
				case 18:
					errn = decode_dinPaymentDetailsResType(stream, &dinBodyType->PaymentDetailsRes);
					dinBodyType->PaymentDetailsRes_isUsed = 1u;
					grammarID = 4;
					break;
				case 19:
					errn = decode_dinPowerDeliveryReqType(stream, &dinBodyType->PowerDeliveryReq);
					dinBodyType->PowerDeliveryReq_isUsed = 1u;
					grammarID = 4;
					break;
				case 20:
					errn = decode_dinPowerDeliveryResType(stream, &dinBodyType->PowerDeliveryRes);
					dinBodyType->PowerDeliveryRes_isUsed = 1u;
					grammarID = 4;
					break;
				case 21:
					errn = decode_dinPreChargeReqType(stream, &dinBodyType->PreChargeReq);
					dinBodyType->PreChargeReq_isUsed = 1u;
					grammarID = 4;
					break;
				case 22:
					errn = decode_dinPreChargeResType(stream, &dinBodyType->PreChargeRes);
					dinBodyType->PreChargeRes_isUsed = 1u;
					grammarID = 4;
					break;
				case 23:
					errn = decode_dinServiceDetailReqType(stream, &dinBodyType->ServiceDetailReq);
					dinBodyType->ServiceDetailReq_isUsed = 1u;
					grammarID = 4;
					break;
				case 24:
					errn = decode_dinServiceDetailResType(stream, &dinBodyType->ServiceDetailRes);
					dinBodyType->ServiceDetailRes_isUsed = 1u;
					grammarID = 4;
					break;
				case 25:
					errn = decode_dinServiceDiscoveryReqType(stream, &dinBodyType->ServiceDiscoveryReq);
					dinBodyType->ServiceDiscoveryReq_isUsed = 1u;
					grammarID = 4;
					break;
				case 26:
					errn = decode_dinServiceDiscoveryResType(stream, &dinBodyType->ServiceDiscoveryRes);
					dinBodyType->ServiceDiscoveryRes_isUsed = 1u;
					grammarID = 4;
					break;
				case 27:
					errn = decode_dinServicePaymentSelectionReqType(stream, &dinBodyType->ServicePaymentSelectionReq);
					dinBodyType->ServicePaymentSelectionReq_isUsed = 1u;
					grammarID = 4;
					break;
				case 28:
					errn = decode_dinServicePaymentSelectionResType(stream, &dinBodyType->ServicePaymentSelectionRes);
					dinBodyType->ServicePaymentSelectionRes_isUsed = 1u;
					grammarID = 4;
					break;
				case 29:
					errn = decode_dinSessionSetupReqType(stream, &dinBodyType->SessionSetupReq);
					dinBodyType->SessionSetupReq_isUsed = 1u;
					grammarID = 4;
					break;
				case 30:
					errn = decode_dinSessionSetupResType(stream, &dinBodyType->SessionSetupRes);
					dinBodyType->SessionSetupRes_isUsed = 1u;
					grammarID = 4;
					break;
				case 31:
					errn = decode_dinSessionStopType(stream, &dinBodyType->SessionStopReq);
					dinBodyType->SessionStopReq_isUsed = 1u;
					grammarID = 4;
					break;
				case 32:
					errn = decode_dinSessionStopResType(stream, &dinBodyType->SessionStopRes);
					dinBodyType->SessionStopRes_isUsed = 1u;
					grammarID = 4;
					break;
				case 33:
					errn = decode_dinWeldingDetectionReqType(stream, &dinBodyType->WeldingDetectionReq);
					dinBodyType->WeldingDetectionReq_isUsed = 1u;
					grammarID = 4;
					break;
				case 34:
					errn = decode_dinWeldingDetectionResType(stream, &dinBodyType->WeldingDetectionRes);
					dinBodyType->WeldingDetectionRes_isUsed = 1u;
					grammarID = 4;
					break;
				case 35:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 4:
			/* Element[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgBody,SessionSetupReqType',  base type name='BodyBaseType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("urn:iso:15118:2:2010:MsgBody":EVCCID)',  derivedBy='EXTENSION'.  */
static int decode_dinSessionSetupReqType(bitstream_t* stream, struct dinSessionSetupReqType* dinSessionSetupReqType) {
	int grammarID = 7;
	int done = 0;
	
	init_dinSessionSetupReqType(dinSessionSetupReqType);
	
	while(!done) {
		switch(grammarID) {
		case 7:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVCCID)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[BINARY_HEX]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger16(stream, &dinSessionSetupReqType->EVCCID.bytesLen);
							if (errn == 0) {
								errn =  (dinSessionSetupReqType->EVCCID.bytesLen) <= dinSessionSetupReqType_EVCCID_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
							}
							if (errn == 0) {
								errn = decodeBytes(stream, dinSessionSetupReqType->EVCCID.bytesLen, dinSessionSetupReqType->EVCCID.bytes);
							}
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVCCID) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 4;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 4:
			/* Element[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgBody,PowerDeliveryResType',  base type name='BodyBaseType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgDataTypes":EVSEStatus)',  derivedBy='EXTENSION'.  */
static int decode_dinPowerDeliveryResType(bitstream_t* stream, struct dinPowerDeliveryResType* dinPowerDeliveryResType) {
	int grammarID = 8;
	int done = 0;
	
	init_dinPowerDeliveryResType(dinPowerDeliveryResType);
	
	while(!done) {
		switch(grammarID) {
		case 8:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[ENUMERATION]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeNBitUnsignedInteger(stream, 5, &uint32);
							dinPowerDeliveryResType->ResponseCode = (dinresponseCodeType) uint32;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 9;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 9:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEStatus)] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinAC_EVSEStatusType(stream, &dinPowerDeliveryResType->AC_EVSEStatus);
					dinPowerDeliveryResType->AC_EVSEStatus_isUsed = 1u;
					grammarID = 4;
					break;
				case 1:
					errn = decode_dinDC_EVSEStatusType(stream, &dinPowerDeliveryResType->DC_EVSEStatus);
					dinPowerDeliveryResType->DC_EVSEStatus_isUsed = 1u;
					grammarID = 4;
					break;
				case 2:
					errn = decode_dinEVSEStatusType(stream, &dinPowerDeliveryResType->EVSEStatus);
					dinPowerDeliveryResType->EVSEStatus_isUsed = 1u;
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 4:
			/* Element[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgBody,ServiceDetailResType',  base type name='BodyBaseType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":ServiceID,"urn:iso:15118:2:2010:MsgBody":ServiceParameterList{0-1})',  derivedBy='EXTENSION'.  */
static int decode_dinServiceDetailResType(bitstream_t* stream, struct dinServiceDetailResType* dinServiceDetailResType) {
	int grammarID = 10;
	int done = 0;
	
	init_dinServiceDetailResType(dinServiceDetailResType);
	
	while(!done) {
		switch(grammarID) {
		case 10:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[ENUMERATION]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeNBitUnsignedInteger(stream, 5, &uint32);
							dinServiceDetailResType->ResponseCode = (dinresponseCodeType) uint32;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 11;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 11:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceID)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger16(stream, &dinServiceDetailResType->ServiceID);
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceID) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 12;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 12:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceParameterList), END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinServiceParameterListType(stream, &dinServiceDetailResType->ServiceParameterList);
					dinServiceDetailResType->ServiceParameterList_isUsed = 1u;
					grammarID = 4;
					break;
				case 1:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 4:
			/* Element[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgBody,WeldingDetectionResType',  base type name='BodyBaseType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2010:MsgBody":EVSEPresentVoltage)',  derivedBy='EXTENSION'.  */
static int decode_dinWeldingDetectionResType(bitstream_t* stream, struct dinWeldingDetectionResType* dinWeldingDetectionResType) {
	int grammarID = 13;
	int done = 0;
	
	init_dinWeldingDetectionResType(dinWeldingDetectionResType);
	
	while(!done) {
		switch(grammarID) {
		case 13:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[ENUMERATION]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeNBitUnsignedInteger(stream, 5, &uint32);
							dinWeldingDetectionResType->ResponseCode = (dinresponseCodeType) uint32;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 14;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 14:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVSEStatus)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinDC_EVSEStatusType(stream, &dinWeldingDetectionResType->DC_EVSEStatus);
					grammarID = 15;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 15:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEPresentVoltage)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinPhysicalValueType(stream, &dinWeldingDetectionResType->EVSEPresentVoltage);
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 4:
			/* Element[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgBody,ContractAuthenticationResType',  base type name='BodyBaseType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":EVSEProcessing)',  derivedBy='EXTENSION'.  */
static int decode_dinContractAuthenticationResType(bitstream_t* stream, struct dinContractAuthenticationResType* dinContractAuthenticationResType) {
	int grammarID = 16;
	int done = 0;
	
	init_dinContractAuthenticationResType(dinContractAuthenticationResType);
	
	while(!done) {
		switch(grammarID) {
		case 16:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[ENUMERATION]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeNBitUnsignedInteger(stream, 5, &uint32);
							dinContractAuthenticationResType->ResponseCode = (dinresponseCodeType) uint32;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 17;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 17:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEProcessing)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[ENUMERATION]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeNBitUnsignedInteger(stream, 1, &uint32);
							dinContractAuthenticationResType->EVSEProcessing = (dinEVSEProcessingType) uint32;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEProcessing) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 4;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 4:
			/* Element[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='http://www.w3.org/2000/09/xmldsig#,CanonicalizationMethodType',  base type name='anyType',  content type='MIXED',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='((WC[##any]){0-UNBOUNDED})',  derivedBy='RESTRICTION'.  */
static int decode_dinCanonicalizationMethodType(bitstream_t* stream, struct dinCanonicalizationMethodType* dinCanonicalizationMethodType) {
	int grammarID = 18;
	int done = 0;
	
	init_dinCanonicalizationMethodType(dinCanonicalizationMethodType);
	
	while(!done) {
		switch(grammarID) {
		case 18:
			/* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decodeUnsignedInteger16(stream, &dinCanonicalizationMethodType->Algorithm.charactersLen);
					if (errn == 0) {
						if (dinCanonicalizationMethodType->Algorithm.charactersLen >= 2) {
							dinCanonicalizationMethodType->Algorithm.charactersLen = (uint16_t)(dinCanonicalizationMethodType->Algorithm.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, dinCanonicalizationMethodType->Algorithm.charactersLen, dinCanonicalizationMethodType->Algorithm.characters, dinCanonicalizationMethodType_Algorithm_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					grammarID = 19;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 19:
			/* StartTag[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					/* TODO unsupported event : START_ELEMENT_GENERIC */
					grammarID = 20;
					break;
				case 1:
					done = 1;
					grammarID = 5;
					break;
				case 2:
					errn = decodeUnsignedInteger16(stream, &dinCanonicalizationMethodType->ANY.charactersLen);
					if (errn == 0) {
						if (dinCanonicalizationMethodType->ANY.charactersLen >= 2) {
							dinCanonicalizationMethodType->ANY.charactersLen = (uint16_t)(dinCanonicalizationMethodType->ANY.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, dinCanonicalizationMethodType->ANY.charactersLen, dinCanonicalizationMethodType->ANY.characters, dinCanonicalizationMethodType_ANY_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					dinCanonicalizationMethodType->ANY_isUsed = 1u;
					grammarID = 20;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 20:
			/* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					/* TODO unsupported event : START_ELEMENT_GENERIC */
					grammarID = 20;
					break;
				case 1:
					done = 1;
					grammarID = 5;
					break;
				case 2:
					errn = decodeUnsignedInteger16(stream, &dinCanonicalizationMethodType->ANY.charactersLen);
					if (errn == 0) {
						if (dinCanonicalizationMethodType->ANY.charactersLen >= 2) {
							dinCanonicalizationMethodType->ANY.charactersLen = (uint16_t)(dinCanonicalizationMethodType->ANY.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, dinCanonicalizationMethodType->ANY.charactersLen, dinCanonicalizationMethodType->ANY.characters, dinCanonicalizationMethodType_ANY_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					dinCanonicalizationMethodType->ANY_isUsed = 1u;
					grammarID = 20;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SPKIDataType',  base type name='anyType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("http://www.w3.org/2000/09/xmldsig#":SPKISexp,(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-1}){1-UNBOUNDED}',  derivedBy='RESTRICTION'.  */
static int decode_dinSPKIDataType(bitstream_t* stream, struct dinSPKIDataType* dinSPKIDataType) {
	int grammarID = 21;
	int done = 0;
	
	init_dinSPKIDataType(dinSPKIDataType);
	
	while(!done) {
		switch(grammarID) {
		case 21:
			/* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					if (dinSPKIDataType->SPKISexp.arrayLen < dinSPKIDataType_SPKISexp_ARRAY_SIZE) {
						/* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(errn == 0) {
							if(eventCode == 0) {
								errn = decodeUnsignedInteger16(stream, &dinSPKIDataType->SPKISexp.array[dinSPKIDataType->SPKISexp.arrayLen].bytesLen);
								if (errn == 0) {
									errn =  (dinSPKIDataType->SPKISexp.array[dinSPKIDataType->SPKISexp.arrayLen].bytesLen) <= dinSPKIDataType_SPKISexp_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
								}
								if (errn == 0) {
									errn = decodeBytes(stream, dinSPKIDataType->SPKISexp.array[dinSPKIDataType->SPKISexp.arrayLen].bytesLen, dinSPKIDataType->SPKISexp.array[dinSPKIDataType->SPKISexp.arrayLen].bytes);
								}
								dinSPKIDataType->SPKISexp.arrayLen++;
							} else {
								/* Second level event (e.g., xsi:type, xsi:nil, ...) */
								errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
							}
						}
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 22;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 22:
			/* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp), START_ELEMENT_GENERIC, END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					if (dinSPKIDataType->SPKISexp.arrayLen < dinSPKIDataType_SPKISexp_ARRAY_SIZE) {
						/* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(errn == 0) {
							if(eventCode == 0) {
								errn = decodeUnsignedInteger16(stream, &dinSPKIDataType->SPKISexp.array[dinSPKIDataType->SPKISexp.arrayLen].bytesLen);
								if (errn == 0) {
									errn =  (dinSPKIDataType->SPKISexp.array[dinSPKIDataType->SPKISexp.arrayLen].bytesLen) <= dinSPKIDataType_SPKISexp_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
								}
								if (errn == 0) {
									errn = decodeBytes(stream, dinSPKIDataType->SPKISexp.array[dinSPKIDataType->SPKISexp.arrayLen].bytesLen, dinSPKIDataType->SPKISexp.array[dinSPKIDataType->SPKISexp.arrayLen].bytes);
								}
								dinSPKIDataType->SPKISexp.arrayLen++;
							} else {
								/* Second level event (e.g., xsi:type, xsi:nil, ...) */
								errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
							}
						}
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 22;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 1:
					errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					/* TODO unsupported event : START_ELEMENT_GENERIC */
					grammarID = 23;
					break;
				case 2:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 23:
			/* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp), END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					if (dinSPKIDataType->SPKISexp.arrayLen < dinSPKIDataType_SPKISexp_ARRAY_SIZE) {
						/* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(errn == 0) {
							if(eventCode == 0) {
								errn = decodeUnsignedInteger16(stream, &dinSPKIDataType->SPKISexp.array[dinSPKIDataType->SPKISexp.arrayLen].bytesLen);
								if (errn == 0) {
									errn =  (dinSPKIDataType->SPKISexp.array[dinSPKIDataType->SPKISexp.arrayLen].bytesLen) <= dinSPKIDataType_SPKISexp_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
								}
								if (errn == 0) {
									errn = decodeBytes(stream, dinSPKIDataType->SPKISexp.array[dinSPKIDataType->SPKISexp.arrayLen].bytesLen, dinSPKIDataType->SPKISexp.array[dinSPKIDataType->SPKISexp.arrayLen].bytes);
								}
								dinSPKIDataType->SPKISexp.arrayLen++;
							} else {
								/* Second level event (e.g., xsi:type, xsi:nil, ...) */
								errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
							}
						}
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 22;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 1:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ListOfRootCertificateIDsType',  base type name='anyType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("urn:iso:15118:2:2010:MsgDataTypes":RootCertificateID{1-UNBOUNDED})',  derivedBy='RESTRICTION'.  */
static int decode_dinListOfRootCertificateIDsType(bitstream_t* stream, struct dinListOfRootCertificateIDsType* dinListOfRootCertificateIDsType) {
	int grammarID = 24;
	int done = 0;
	
	init_dinListOfRootCertificateIDsType(dinListOfRootCertificateIDsType);
	
	while(!done) {
		switch(grammarID) {
		case 24:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RootCertificateID)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					if (dinListOfRootCertificateIDsType->RootCertificateID.arrayLen < dinListOfRootCertificateIDsType_RootCertificateID_ARRAY_SIZE) {
						/* FirstStartTag[CHARACTERS[STRING]] */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(errn == 0) {
							if(eventCode == 0) {
								errn = decodeUnsignedInteger16(stream, &dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType->RootCertificateID.arrayLen].charactersLen);
								if (errn == 0) {
									if (dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType->RootCertificateID.arrayLen].charactersLen >= 2) {
										dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType->RootCertificateID.arrayLen].charactersLen = (uint16_t)(dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType->RootCertificateID.arrayLen].charactersLen - 2); /* string table miss */
										errn = decodeCharacters(stream, dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType->RootCertificateID.arrayLen].charactersLen, dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType->RootCertificateID.arrayLen].characters, dinListOfRootCertificateIDsType_RootCertificateID_CHARACTERS_SIZE);
									} else {
										/* string table hit */
										errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
									}
								}
								dinListOfRootCertificateIDsType->RootCertificateID.arrayLen++;
							} else {
								/* Second level event (e.g., xsi:type, xsi:nil, ...) */
								errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
							}
						}
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RootCertificateID) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 25;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 25:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RootCertificateID), END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					if (dinListOfRootCertificateIDsType->RootCertificateID.arrayLen < dinListOfRootCertificateIDsType_RootCertificateID_ARRAY_SIZE) {
						/* FirstStartTag[CHARACTERS[STRING]] */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(errn == 0) {
							if(eventCode == 0) {
								errn = decodeUnsignedInteger16(stream, &dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType->RootCertificateID.arrayLen].charactersLen);
								if (errn == 0) {
									if (dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType->RootCertificateID.arrayLen].charactersLen >= 2) {
										dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType->RootCertificateID.arrayLen].charactersLen = (uint16_t)(dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType->RootCertificateID.arrayLen].charactersLen - 2); /* string table miss */
										errn = decodeCharacters(stream, dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType->RootCertificateID.arrayLen].charactersLen, dinListOfRootCertificateIDsType->RootCertificateID.array[dinListOfRootCertificateIDsType->RootCertificateID.arrayLen].characters, dinListOfRootCertificateIDsType_RootCertificateID_CHARACTERS_SIZE);
									} else {
										/* string table hit */
										errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
									}
								}
								dinListOfRootCertificateIDsType->RootCertificateID.arrayLen++;
							} else {
								/* Second level event (e.g., xsi:type, xsi:nil, ...) */
								errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
							}
						}
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RootCertificateID) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 25;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 1:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SelectedServiceListType',  base type name='anyType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("urn:iso:15118:2:2010:MsgDataTypes":SelectedService{1-UNBOUNDED})',  derivedBy='RESTRICTION'.  */
static int decode_dinSelectedServiceListType(bitstream_t* stream, struct dinSelectedServiceListType* dinSelectedServiceListType) {
	int grammarID = 26;
	int done = 0;
	
	init_dinSelectedServiceListType(dinSelectedServiceListType);
	
	while(!done) {
		switch(grammarID) {
		case 26:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SelectedService)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					if (dinSelectedServiceListType->SelectedService.arrayLen < dinSelectedServiceListType_SelectedService_ARRAY_SIZE) {
						errn = decode_dinSelectedServiceType(stream, &dinSelectedServiceListType->SelectedService.array[dinSelectedServiceListType->SelectedService.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 27;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 27:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SelectedService), END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					if (dinSelectedServiceListType->SelectedService.arrayLen < dinSelectedServiceListType_SelectedService_ARRAY_SIZE) {
						errn = decode_dinSelectedServiceType(stream, &dinSelectedServiceListType->SelectedService.array[dinSelectedServiceListType->SelectedService.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 27;
					break;
				case 1:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgBody,CurrentDemandResType',  base type name='BodyBaseType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2010:MsgBody":EVSEPresentVoltage,"urn:iso:15118:2:2010:MsgBody":EVSEPresentCurrent,"urn:iso:15118:2:2010:MsgBody":EVSECurrentLimitAchieved,"urn:iso:15118:2:2010:MsgBody":EVSEVoltageLimitAchieved,"urn:iso:15118:2:2010:MsgBody":EVSEPowerLimitAchieved,"urn:iso:15118:2:2010:MsgBody":EVSEMaximumVoltageLimit{0-1},"urn:iso:15118:2:2010:MsgBody":EVSEMaximumCurrentLimit{0-1},"urn:iso:15118:2:2010:MsgBody":EVSEMaximumPowerLimit{0-1})',  derivedBy='EXTENSION'.  */
static int decode_dinCurrentDemandResType(bitstream_t* stream, struct dinCurrentDemandResType* dinCurrentDemandResType) {
	int grammarID = 28;
	int done = 0;
	
	init_dinCurrentDemandResType(dinCurrentDemandResType);
	
	while(!done) {
		switch(grammarID) {
		case 28:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[ENUMERATION]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeNBitUnsignedInteger(stream, 5, &uint32);
							dinCurrentDemandResType->ResponseCode = (dinresponseCodeType) uint32;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 29;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 29:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVSEStatus)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinDC_EVSEStatusType(stream, &dinCurrentDemandResType->DC_EVSEStatus);
					grammarID = 30;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 30:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEPresentVoltage)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandResType->EVSEPresentVoltage);
					grammarID = 31;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 31:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEPresentCurrent)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandResType->EVSEPresentCurrent);
					grammarID = 32;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 32:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSECurrentLimitAchieved)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[BOOLEAN]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeBoolean(stream, &dinCurrentDemandResType->EVSECurrentLimitAchieved);
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSECurrentLimitAchieved) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 33;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 33:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEVoltageLimitAchieved)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[BOOLEAN]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeBoolean(stream, &dinCurrentDemandResType->EVSEVoltageLimitAchieved);
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEVoltageLimitAchieved) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 34;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 34:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEPowerLimitAchieved)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[BOOLEAN]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeBoolean(stream, &dinCurrentDemandResType->EVSEPowerLimitAchieved);
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEPowerLimitAchieved) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 35;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 35:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaximumVoltageLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaximumPowerLimit), END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 3, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandResType->EVSEMaximumVoltageLimit);
					dinCurrentDemandResType->EVSEMaximumVoltageLimit_isUsed = 1u;
					grammarID = 36;
					break;
				case 1:
					errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandResType->EVSEMaximumCurrentLimit);
					dinCurrentDemandResType->EVSEMaximumCurrentLimit_isUsed = 1u;
					grammarID = 37;
					break;
				case 2:
					errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandResType->EVSEMaximumPowerLimit);
					dinCurrentDemandResType->EVSEMaximumPowerLimit_isUsed = 1u;
					grammarID = 4;
					break;
				case 3:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 36:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaximumPowerLimit), END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandResType->EVSEMaximumCurrentLimit);
					dinCurrentDemandResType->EVSEMaximumCurrentLimit_isUsed = 1u;
					grammarID = 37;
					break;
				case 1:
					errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandResType->EVSEMaximumPowerLimit);
					dinCurrentDemandResType->EVSEMaximumPowerLimit_isUsed = 1u;
					grammarID = 4;
					break;
				case 2:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 37:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaximumPowerLimit), END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandResType->EVSEMaximumPowerLimit);
					dinCurrentDemandResType->EVSEMaximumPowerLimit_isUsed = 1u;
					grammarID = 4;
					break;
				case 1:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 4:
			/* Element[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformType',  base type name='anyType',  content type='MIXED',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])|"http://www.w3.org/2000/09/xmldsig#":XPath){0-UNBOUNDED}',  derivedBy='RESTRICTION'.  */
static int decode_dinTransformType(bitstream_t* stream, struct dinTransformType* dinTransformType) {
	int grammarID = 38;
	int done = 0;
	
	init_dinTransformType(dinTransformType);
	
	while(!done) {
		switch(grammarID) {
		case 38:
			/* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decodeUnsignedInteger16(stream, &dinTransformType->Algorithm.charactersLen);
					if (errn == 0) {
						if (dinTransformType->Algorithm.charactersLen >= 2) {
							dinTransformType->Algorithm.charactersLen = (uint16_t)(dinTransformType->Algorithm.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, dinTransformType->Algorithm.charactersLen, dinTransformType->Algorithm.characters, dinTransformType_Algorithm_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					grammarID = 39;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 39:
			/* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}XPath), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */
			errn = decodeNBitUnsignedInteger(stream, 3, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					if (dinTransformType->XPath.arrayLen < dinTransformType_XPath_ARRAY_SIZE) {
						/* First(xsi:type)StartTag[CHARACTERS[STRING]] */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(errn == 0) {
							if(eventCode == 0) {
								errn = decodeUnsignedInteger16(stream, &dinTransformType->XPath.array[dinTransformType->XPath.arrayLen].charactersLen);
								if (errn == 0) {
									if (dinTransformType->XPath.array[dinTransformType->XPath.arrayLen].charactersLen >= 2) {
										dinTransformType->XPath.array[dinTransformType->XPath.arrayLen].charactersLen = (uint16_t)(dinTransformType->XPath.array[dinTransformType->XPath.arrayLen].charactersLen - 2); /* string table miss */
										errn = decodeCharacters(stream, dinTransformType->XPath.array[dinTransformType->XPath.arrayLen].charactersLen, dinTransformType->XPath.array[dinTransformType->XPath.arrayLen].characters, dinTransformType_XPath_CHARACTERS_SIZE);
									} else {
										/* string table hit */
										errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
									}
								}
								dinTransformType->XPath.arrayLen++;
							} else {
								/* Second level event (e.g., xsi:type, xsi:nil, ...) */
								errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
							}
						}
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}XPath) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 40;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 1:
					errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					/* TODO unsupported event : START_ELEMENT_GENERIC */
					grammarID = 40;
					break;
				case 2:
					done = 1;
					grammarID = 5;
					break;
				case 3:
					errn = decodeUnsignedInteger16(stream, &dinTransformType->ANY.charactersLen);
					if (errn == 0) {
						if (dinTransformType->ANY.charactersLen >= 2) {
							dinTransformType->ANY.charactersLen = (uint16_t)(dinTransformType->ANY.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, dinTransformType->ANY.charactersLen, dinTransformType->ANY.characters, dinTransformType_ANY_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					dinTransformType->ANY_isUsed = 1u;
					grammarID = 40;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 40:
			/* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}XPath), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */
			errn = decodeNBitUnsignedInteger(stream, 3, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					if (dinTransformType->XPath.arrayLen < dinTransformType_XPath_ARRAY_SIZE) {
						/* First(xsi:type)StartTag[CHARACTERS[STRING]] */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(errn == 0) {
							if(eventCode == 0) {
								errn = decodeUnsignedInteger16(stream, &dinTransformType->XPath.array[dinTransformType->XPath.arrayLen].charactersLen);
								if (errn == 0) {
									if (dinTransformType->XPath.array[dinTransformType->XPath.arrayLen].charactersLen >= 2) {
										dinTransformType->XPath.array[dinTransformType->XPath.arrayLen].charactersLen = (uint16_t)(dinTransformType->XPath.array[dinTransformType->XPath.arrayLen].charactersLen - 2); /* string table miss */
										errn = decodeCharacters(stream, dinTransformType->XPath.array[dinTransformType->XPath.arrayLen].charactersLen, dinTransformType->XPath.array[dinTransformType->XPath.arrayLen].characters, dinTransformType_XPath_CHARACTERS_SIZE);
									} else {
										/* string table hit */
										errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
									}
								}
								dinTransformType->XPath.arrayLen++;
							} else {
								/* Second level event (e.g., xsi:type, xsi:nil, ...) */
								errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
							}
						}
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}XPath) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 40;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 1:
					errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					/* TODO unsupported event : START_ELEMENT_GENERIC */
					grammarID = 40;
					break;
				case 2:
					done = 1;
					grammarID = 5;
					break;
				case 3:
					errn = decodeUnsignedInteger16(stream, &dinTransformType->ANY.charactersLen);
					if (errn == 0) {
						if (dinTransformType->ANY.charactersLen >= 2) {
							dinTransformType->ANY.charactersLen = (uint16_t)(dinTransformType->ANY.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, dinTransformType->ANY.charactersLen, dinTransformType->ANY.characters, dinTransformType_ANY_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					dinTransformType->ANY_isUsed = 1u;
					grammarID = 40;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,AC_EVChargeParameterType',  base type name='EVChargeParameterType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("urn:iso:15118:2:2010:MsgDataTypes":DepartureTime,"urn:iso:15118:2:2010:MsgDataTypes":EAmount,"urn:iso:15118:2:2010:MsgDataTypes":EVMaxVoltage,"urn:iso:15118:2:2010:MsgDataTypes":EVMaxCurrent,"urn:iso:15118:2:2010:MsgDataTypes":EVMinCurrent)',  derivedBy='EXTENSION'.  */
static int decode_dinAC_EVChargeParameterType(bitstream_t* stream, struct dinAC_EVChargeParameterType* dinAC_EVChargeParameterType) {
	int grammarID = 41;
	int done = 0;
	
	init_dinAC_EVChargeParameterType(dinAC_EVChargeParameterType);
	
	while(!done) {
		switch(grammarID) {
		case 41:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DepartureTime)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger32(stream, &dinAC_EVChargeParameterType->DepartureTime);
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DepartureTime) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 42;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 42:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EAmount)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinPhysicalValueType(stream, &dinAC_EVChargeParameterType->EAmount);
					grammarID = 43;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 43:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaxVoltage)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinPhysicalValueType(stream, &dinAC_EVChargeParameterType->EVMaxVoltage);
					grammarID = 44;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 44:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaxCurrent)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinPhysicalValueType(stream, &dinAC_EVChargeParameterType->EVMaxCurrent);
					grammarID = 45;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 45:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMinCurrent)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinPhysicalValueType(stream, &dinAC_EVChargeParameterType->EVMinCurrent);
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 4:
			/* Element[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='http://www.w3.org/2000/09/xmldsig#,X509DataType',  base type name='anyType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='(("http://www.w3.org/2000/09/xmldsig#":X509IssuerSerial|"http://www.w3.org/2000/09/xmldsig#":X509SKI|"http://www.w3.org/2000/09/xmldsig#":X509SubjectName|"http://www.w3.org/2000/09/xmldsig#":X509Certificate|"http://www.w3.org/2000/09/xmldsig#":X509CRL|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]))){1-UNBOUNDED}',  derivedBy='RESTRICTION'.  */
static int decode_dinX509DataType(bitstream_t* stream, struct dinX509DataType* dinX509DataType) {
	int grammarID = 46;
	int done = 0;
	
	init_dinX509DataType(dinX509DataType);
	
	while(!done) {
		switch(grammarID) {
		case 46:
			/* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerSerial), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL), START_ELEMENT_GENERIC] */
			errn = decodeNBitUnsignedInteger(stream, 3, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					if (dinX509DataType->X509IssuerSerial.arrayLen < dinX509DataType_X509IssuerSerial_ARRAY_SIZE) {
						errn = decode_dinX509IssuerSerialType(stream, &dinX509DataType->X509IssuerSerial.array[dinX509DataType->X509IssuerSerial.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 47;
					break;
				case 1:
					if (dinX509DataType->X509SKI.arrayLen < dinX509DataType_X509SKI_ARRAY_SIZE) {
						/* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(errn == 0) {
							if(eventCode == 0) {
								errn = decodeUnsignedInteger16(stream, &dinX509DataType->X509SKI.array[dinX509DataType->X509SKI.arrayLen].bytesLen);
								if (errn == 0) {
									errn =  (dinX509DataType->X509SKI.array[dinX509DataType->X509SKI.arrayLen].bytesLen) <= dinX509DataType_X509SKI_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
								}
								if (errn == 0) {
									errn = decodeBytes(stream, dinX509DataType->X509SKI.array[dinX509DataType->X509SKI.arrayLen].bytesLen, dinX509DataType->X509SKI.array[dinX509DataType->X509SKI.arrayLen].bytes);
								}
								dinX509DataType->X509SKI.arrayLen++;
							} else {
								/* Second level event (e.g., xsi:type, xsi:nil, ...) */
								errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
							}
						}
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 47;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 2:
					if (dinX509DataType->X509SubjectName.arrayLen < dinX509DataType_X509SubjectName_ARRAY_SIZE) {
						/* First(xsi:type)StartTag[CHARACTERS[STRING]] */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(errn == 0) {
							if(eventCode == 0) {
								errn = decodeUnsignedInteger16(stream, &dinX509DataType->X509SubjectName.array[dinX509DataType->X509SubjectName.arrayLen].charactersLen);
								if (errn == 0) {
									if (dinX509DataType->X509SubjectName.array[dinX509DataType->X509SubjectName.arrayLen].charactersLen >= 2) {
										dinX509DataType->X509SubjectName.array[dinX509DataType->X509SubjectName.arrayLen].charactersLen = (uint16_t)(dinX509DataType->X509SubjectName.array[dinX509DataType->X509SubjectName.arrayLen].charactersLen - 2); /* string table miss */
										errn = decodeCharacters(stream, dinX509DataType->X509SubjectName.array[dinX509DataType->X509SubjectName.arrayLen].charactersLen, dinX509DataType->X509SubjectName.array[dinX509DataType->X509SubjectName.arrayLen].characters, dinX509DataType_X509SubjectName_CHARACTERS_SIZE);
									} else {
										/* string table hit */
										errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
									}
								}
								dinX509DataType->X509SubjectName.arrayLen++;
							} else {
								/* Second level event (e.g., xsi:type, xsi:nil, ...) */
								errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
							}
						}
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 47;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 3:
					if (dinX509DataType->X509Certificate.arrayLen < dinX509DataType_X509Certificate_ARRAY_SIZE) {
						/* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(errn == 0) {
							if(eventCode == 0) {
								errn = decodeUnsignedInteger16(stream, &dinX509DataType->X509Certificate.array[dinX509DataType->X509Certificate.arrayLen].bytesLen);
								if (errn == 0) {
									errn =  (dinX509DataType->X509Certificate.array[dinX509DataType->X509Certificate.arrayLen].bytesLen) <= dinX509DataType_X509Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
								}
								if (errn == 0) {
									errn = decodeBytes(stream, dinX509DataType->X509Certificate.array[dinX509DataType->X509Certificate.arrayLen].bytesLen, dinX509DataType->X509Certificate.array[dinX509DataType->X509Certificate.arrayLen].bytes);
								}
								dinX509DataType->X509Certificate.arrayLen++;
							} else {
								/* Second level event (e.g., xsi:type, xsi:nil, ...) */
								errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
							}
						}
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 47;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 4:
					if (dinX509DataType->X509CRL.arrayLen < dinX509DataType_X509CRL_ARRAY_SIZE) {
						/* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(errn == 0) {
							if(eventCode == 0) {
								errn = decodeUnsignedInteger16(stream, &dinX509DataType->X509CRL.array[dinX509DataType->X509CRL.arrayLen].bytesLen);
								if (errn == 0) {
									errn =  (dinX509DataType->X509CRL.array[dinX509DataType->X509CRL.arrayLen].bytesLen) <= dinX509DataType_X509CRL_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
								}
								if (errn == 0) {
									errn = decodeBytes(stream, dinX509DataType->X509CRL.array[dinX509DataType->X509CRL.arrayLen].bytesLen, dinX509DataType->X509CRL.array[dinX509DataType->X509CRL.arrayLen].bytes);
								}
								dinX509DataType->X509CRL.arrayLen++;
							} else {
								/* Second level event (e.g., xsi:type, xsi:nil, ...) */
								errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
							}
						}
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 47;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 5:
					errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					/* TODO unsupported event : START_ELEMENT_GENERIC */
					grammarID = 47;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 47:
			/* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerSerial), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL), START_ELEMENT_GENERIC, END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 3, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					if (dinX509DataType->X509IssuerSerial.arrayLen < dinX509DataType_X509IssuerSerial_ARRAY_SIZE) {
						errn = decode_dinX509IssuerSerialType(stream, &dinX509DataType->X509IssuerSerial.array[dinX509DataType->X509IssuerSerial.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 47;
					break;
				case 1:
					if (dinX509DataType->X509SKI.arrayLen < dinX509DataType_X509SKI_ARRAY_SIZE) {
						/* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(errn == 0) {
							if(eventCode == 0) {
								errn = decodeUnsignedInteger16(stream, &dinX509DataType->X509SKI.array[dinX509DataType->X509SKI.arrayLen].bytesLen);
								if (errn == 0) {
									errn =  (dinX509DataType->X509SKI.array[dinX509DataType->X509SKI.arrayLen].bytesLen) <= dinX509DataType_X509SKI_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
								}
								if (errn == 0) {
									errn = decodeBytes(stream, dinX509DataType->X509SKI.array[dinX509DataType->X509SKI.arrayLen].bytesLen, dinX509DataType->X509SKI.array[dinX509DataType->X509SKI.arrayLen].bytes);
								}
								dinX509DataType->X509SKI.arrayLen++;
							} else {
								/* Second level event (e.g., xsi:type, xsi:nil, ...) */
								errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
							}
						}
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 47;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 2:
					if (dinX509DataType->X509SubjectName.arrayLen < dinX509DataType_X509SubjectName_ARRAY_SIZE) {
						/* First(xsi:type)StartTag[CHARACTERS[STRING]] */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(errn == 0) {
							if(eventCode == 0) {
								errn = decodeUnsignedInteger16(stream, &dinX509DataType->X509SubjectName.array[dinX509DataType->X509SubjectName.arrayLen].charactersLen);
								if (errn == 0) {
									if (dinX509DataType->X509SubjectName.array[dinX509DataType->X509SubjectName.arrayLen].charactersLen >= 2) {
										dinX509DataType->X509SubjectName.array[dinX509DataType->X509SubjectName.arrayLen].charactersLen = (uint16_t)(dinX509DataType->X509SubjectName.array[dinX509DataType->X509SubjectName.arrayLen].charactersLen - 2); /* string table miss */
										errn = decodeCharacters(stream, dinX509DataType->X509SubjectName.array[dinX509DataType->X509SubjectName.arrayLen].charactersLen, dinX509DataType->X509SubjectName.array[dinX509DataType->X509SubjectName.arrayLen].characters, dinX509DataType_X509SubjectName_CHARACTERS_SIZE);
									} else {
										/* string table hit */
										errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
									}
								}
								dinX509DataType->X509SubjectName.arrayLen++;
							} else {
								/* Second level event (e.g., xsi:type, xsi:nil, ...) */
								errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
							}
						}
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 47;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 3:
					if (dinX509DataType->X509Certificate.arrayLen < dinX509DataType_X509Certificate_ARRAY_SIZE) {
						/* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(errn == 0) {
							if(eventCode == 0) {
								errn = decodeUnsignedInteger16(stream, &dinX509DataType->X509Certificate.array[dinX509DataType->X509Certificate.arrayLen].bytesLen);
								if (errn == 0) {
									errn =  (dinX509DataType->X509Certificate.array[dinX509DataType->X509Certificate.arrayLen].bytesLen) <= dinX509DataType_X509Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
								}
								if (errn == 0) {
									errn = decodeBytes(stream, dinX509DataType->X509Certificate.array[dinX509DataType->X509Certificate.arrayLen].bytesLen, dinX509DataType->X509Certificate.array[dinX509DataType->X509Certificate.arrayLen].bytes);
								}
								dinX509DataType->X509Certificate.arrayLen++;
							} else {
								/* Second level event (e.g., xsi:type, xsi:nil, ...) */
								errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
							}
						}
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 47;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 4:
					if (dinX509DataType->X509CRL.arrayLen < dinX509DataType_X509CRL_ARRAY_SIZE) {
						/* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(errn == 0) {
							if(eventCode == 0) {
								errn = decodeUnsignedInteger16(stream, &dinX509DataType->X509CRL.array[dinX509DataType->X509CRL.arrayLen].bytesLen);
								if (errn == 0) {
									errn =  (dinX509DataType->X509CRL.array[dinX509DataType->X509CRL.arrayLen].bytesLen) <= dinX509DataType_X509CRL_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
								}
								if (errn == 0) {
									errn = decodeBytes(stream, dinX509DataType->X509CRL.array[dinX509DataType->X509CRL.arrayLen].bytesLen, dinX509DataType->X509CRL.array[dinX509DataType->X509CRL.arrayLen].bytes);
								}
								dinX509DataType->X509CRL.arrayLen++;
							} else {
								/* Second level event (e.g., xsi:type, xsi:nil, ...) */
								errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
							}
						}
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 47;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 5:
					errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					/* TODO unsupported event : START_ELEMENT_GENERIC */
					grammarID = 47;
					break;
				case 6:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgBody,ChargingStatusResType',  base type name='BodyBaseType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":EVSEID,"urn:iso:15118:2:2010:MsgBody":SAScheduleTupleID,"urn:iso:15118:2:2010:MsgBody":EVSEMaxCurrent{0-1},"urn:iso:15118:2:2010:MsgBody":MeterInfo{0-1},"urn:iso:15118:2:2010:MsgBody":ReceiptRequired,"urn:iso:15118:2:2010:MsgBody":AC_EVSEStatus)',  derivedBy='EXTENSION'.  */
static int decode_dinChargingStatusResType(bitstream_t* stream, struct dinChargingStatusResType* dinChargingStatusResType) {
	int grammarID = 48;
	int done = 0;
	
	init_dinChargingStatusResType(dinChargingStatusResType);
	
	while(!done) {
		switch(grammarID) {
		case 48:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[ENUMERATION]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeNBitUnsignedInteger(stream, 5, &uint32);
							dinChargingStatusResType->ResponseCode = (dinresponseCodeType) uint32;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 49;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 49:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEID)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[BINARY_HEX]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger16(stream, &dinChargingStatusResType->EVSEID.bytesLen);
							if (errn == 0) {
								errn =  (dinChargingStatusResType->EVSEID.bytesLen) <= dinChargingStatusResType_EVSEID_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
							}
							if (errn == 0) {
								errn = decodeBytes(stream, dinChargingStatusResType->EVSEID.bytesLen, dinChargingStatusResType->EVSEID.bytes);
							}
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEID) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 50;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 50:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SAScheduleTupleID)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[INTEGER]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeInteger16(stream, &dinChargingStatusResType->SAScheduleTupleID);
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SAScheduleTupleID) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 51;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 51:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaxCurrent), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeterInfo), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReceiptRequired)] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinPhysicalValueType(stream, &dinChargingStatusResType->EVSEMaxCurrent);
					dinChargingStatusResType->EVSEMaxCurrent_isUsed = 1u;
					grammarID = 52;
					break;
				case 1:
					errn = decode_dinMeterInfoType(stream, &dinChargingStatusResType->MeterInfo);
					dinChargingStatusResType->MeterInfo_isUsed = 1u;
					grammarID = 53;
					break;
				case 2:
					/* FirstStartTag[CHARACTERS[BOOLEAN]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeBoolean(stream, &dinChargingStatusResType->ReceiptRequired);
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReceiptRequired) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 54;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 52:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeterInfo), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReceiptRequired)] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinMeterInfoType(stream, &dinChargingStatusResType->MeterInfo);
					dinChargingStatusResType->MeterInfo_isUsed = 1u;
					grammarID = 53;
					break;
				case 1:
					/* FirstStartTag[CHARACTERS[BOOLEAN]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeBoolean(stream, &dinChargingStatusResType->ReceiptRequired);
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReceiptRequired) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 54;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 53:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReceiptRequired)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[BOOLEAN]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeBoolean(stream, &dinChargingStatusResType->ReceiptRequired);
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReceiptRequired) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 54;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 54:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}AC_EVSEStatus)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinAC_EVSEStatusType(stream, &dinChargingStatusResType->AC_EVSEStatus);
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 4:
			/* Element[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgBody,WeldingDetectionReqType',  base type name='BodyBaseType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("urn:iso:15118:2:2010:MsgBody":DC_EVStatus)',  derivedBy='EXTENSION'.  */
static int decode_dinWeldingDetectionReqType(bitstream_t* stream, struct dinWeldingDetectionReqType* dinWeldingDetectionReqType) {
	int grammarID = 55;
	int done = 0;
	
	init_dinWeldingDetectionReqType(dinWeldingDetectionReqType);
	
	while(!done) {
		switch(grammarID) {
		case 55:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVStatus)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinDC_EVStatusType(stream, &dinWeldingDetectionReqType->DC_EVStatus);
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 4:
			/* Element[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignaturePropertiesType',  base type name='anyType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("http://www.w3.org/2000/09/xmldsig#":SignatureProperty{1-UNBOUNDED})',  derivedBy='RESTRICTION'.  */
static int decode_dinSignaturePropertiesType(bitstream_t* stream, struct dinSignaturePropertiesType* dinSignaturePropertiesType) {
	int grammarID = 56;
	int done = 0;
	
	init_dinSignaturePropertiesType(dinSignaturePropertiesType);
	
	while(!done) {
		switch(grammarID) {
		case 56:
			/* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty)] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decodeUnsignedInteger16(stream, &dinSignaturePropertiesType->Id.charactersLen);
					if (errn == 0) {
						if (dinSignaturePropertiesType->Id.charactersLen >= 2) {
							dinSignaturePropertiesType->Id.charactersLen = (uint16_t)(dinSignaturePropertiesType->Id.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, dinSignaturePropertiesType->Id.charactersLen, dinSignaturePropertiesType->Id.characters, dinSignaturePropertiesType_Id_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					dinSignaturePropertiesType->Id_isUsed = 1u;
					grammarID = 57;
					break;
				case 1:
					if (dinSignaturePropertiesType->SignatureProperty.arrayLen < dinSignaturePropertiesType_SignatureProperty_ARRAY_SIZE) {
						errn = decode_dinSignaturePropertyType(stream, &dinSignaturePropertiesType->SignatureProperty.array[dinSignaturePropertiesType->SignatureProperty.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 58;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 57:
			/* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					if (dinSignaturePropertiesType->SignatureProperty.arrayLen < dinSignaturePropertiesType_SignatureProperty_ARRAY_SIZE) {
						errn = decode_dinSignaturePropertyType(stream, &dinSignaturePropertiesType->SignatureProperty.array[dinSignaturePropertiesType->SignatureProperty.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 58;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 58:
			/* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty), END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					if (dinSignaturePropertiesType->SignatureProperty.arrayLen < dinSignaturePropertiesType_SignatureProperty_ARRAY_SIZE) {
						errn = decode_dinSignaturePropertyType(stream, &dinSignaturePropertiesType->SignatureProperty.array[dinSignaturePropertiesType->SignatureProperty.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 58;
					break;
				case 1:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgBody,ContractAuthenticationReqType',  base type name='BodyBaseType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("urn:iso:15118:2:2010:MsgBody":GenChallenge{0-1})',  derivedBy='EXTENSION'.  */
static int decode_dinContractAuthenticationReqType(bitstream_t* stream, struct dinContractAuthenticationReqType* dinContractAuthenticationReqType) {
	int grammarID = 59;
	int done = 0;
	
	init_dinContractAuthenticationReqType(dinContractAuthenticationReqType);
	
	while(!done) {
		switch(grammarID) {
		case 59:
			/* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}GenChallenge), END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decodeUnsignedInteger16(stream, &dinContractAuthenticationReqType->Id.charactersLen);
					if (errn == 0) {
						if (dinContractAuthenticationReqType->Id.charactersLen >= 2) {
							dinContractAuthenticationReqType->Id.charactersLen = (uint16_t)(dinContractAuthenticationReqType->Id.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, dinContractAuthenticationReqType->Id.charactersLen, dinContractAuthenticationReqType->Id.characters, dinContractAuthenticationReqType_Id_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					dinContractAuthenticationReqType->Id_isUsed = 1u;
					grammarID = 60;
					break;
				case 1:
					/* FirstStartTag[CHARACTERS[STRING]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger16(stream, &dinContractAuthenticationReqType->GenChallenge.charactersLen);
							if (errn == 0) {
								if (dinContractAuthenticationReqType->GenChallenge.charactersLen >= 2) {
									dinContractAuthenticationReqType->GenChallenge.charactersLen = (uint16_t)(dinContractAuthenticationReqType->GenChallenge.charactersLen - 2); /* string table miss */
									errn = decodeCharacters(stream, dinContractAuthenticationReqType->GenChallenge.charactersLen, dinContractAuthenticationReqType->GenChallenge.characters, dinContractAuthenticationReqType_GenChallenge_CHARACTERS_SIZE);
								} else {
									/* string table hit */
									errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
								}
							}
							dinContractAuthenticationReqType->GenChallenge_isUsed = 1u;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}GenChallenge) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 4;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 2:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 60:
			/* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}GenChallenge), END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[STRING]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger16(stream, &dinContractAuthenticationReqType->GenChallenge.charactersLen);
							if (errn == 0) {
								if (dinContractAuthenticationReqType->GenChallenge.charactersLen >= 2) {
									dinContractAuthenticationReqType->GenChallenge.charactersLen = (uint16_t)(dinContractAuthenticationReqType->GenChallenge.charactersLen - 2); /* string table miss */
									errn = decodeCharacters(stream, dinContractAuthenticationReqType->GenChallenge.charactersLen, dinContractAuthenticationReqType->GenChallenge.characters, dinContractAuthenticationReqType_GenChallenge_CHARACTERS_SIZE);
								} else {
									/* string table hit */
									errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
								}
							}
							dinContractAuthenticationReqType->GenChallenge_isUsed = 1u;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}GenChallenge) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 4;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 1:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 4:
			/* Element[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVPowerDeliveryParameterType',  base type name='EVPowerDeliveryParameterType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("urn:iso:15118:2:2010:MsgDataTypes":DC_EVStatus,"urn:iso:15118:2:2010:MsgDataTypes":BulkChargingComplete{0-1},"urn:iso:15118:2:2010:MsgDataTypes":ChargingComplete)',  derivedBy='EXTENSION'.  */
static int decode_dinDC_EVPowerDeliveryParameterType(bitstream_t* stream, struct dinDC_EVPowerDeliveryParameterType* dinDC_EVPowerDeliveryParameterType) {
	int grammarID = 61;
	int done = 0;
	
	init_dinDC_EVPowerDeliveryParameterType(dinDC_EVPowerDeliveryParameterType);
	
	while(!done) {
		switch(grammarID) {
		case 61:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVStatus)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinDC_EVStatusType(stream, &dinDC_EVPowerDeliveryParameterType->DC_EVStatus);
					grammarID = 62;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 62:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingComplete)] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[BOOLEAN]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeBoolean(stream, &dinDC_EVPowerDeliveryParameterType->BulkChargingComplete);
							dinDC_EVPowerDeliveryParameterType->BulkChargingComplete_isUsed = 1u;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkChargingComplete) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 63;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 1:
					/* FirstStartTag[CHARACTERS[BOOLEAN]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeBoolean(stream, &dinDC_EVPowerDeliveryParameterType->ChargingComplete);
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingComplete) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 4;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 63:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingComplete)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[BOOLEAN]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeBoolean(stream, &dinDC_EVPowerDeliveryParameterType->ChargingComplete);
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingComplete) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 4;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 4:
			/* Element[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EVSEChargeParameterType',  base type name='anyType',  content type='EMPTY',  isAbstract='true',  hasTypeId='false',  final='0',  block='0',  derivedBy='RESTRICTION'.  */
static int decode_dinEVSEChargeParameterType(bitstream_t* stream, struct dinEVSEChargeParameterType* dinEVSEChargeParameterType) {
	int grammarID = 64;
	int done = 0;
	
	init_dinEVSEChargeParameterType(dinEVSEChargeParameterType);
	
	while(!done) {
		switch(grammarID) {
		case 64:
			/* FirstStartTag[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgBody,CableCheckReqType',  base type name='BodyBaseType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("urn:iso:15118:2:2010:MsgBody":DC_EVStatus)',  derivedBy='EXTENSION'.  */
static int decode_dinCableCheckReqType(bitstream_t* stream, struct dinCableCheckReqType* dinCableCheckReqType) {
	int grammarID = 55;
	int done = 0;
	
	init_dinCableCheckReqType(dinCableCheckReqType);
	
	while(!done) {
		switch(grammarID) {
		case 55:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVStatus)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinDC_EVStatusType(stream, &dinCableCheckReqType->DC_EVStatus);
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 4:
			/* Element[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVChargeParameterType',  base type name='EVChargeParameterType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("urn:iso:15118:2:2010:MsgDataTypes":DC_EVStatus,"urn:iso:15118:2:2010:MsgDataTypes":EVMaximumCurrentLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVMaximumPowerLimit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVMaximumVoltageLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVEnergyCapacity{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVEnergyRequest{0-1},"urn:iso:15118:2:2010:MsgDataTypes":FullSOC{0-1},"urn:iso:15118:2:2010:MsgDataTypes":BulkSOC{0-1})',  derivedBy='EXTENSION'.  */
static int decode_dinDC_EVChargeParameterType(bitstream_t* stream, struct dinDC_EVChargeParameterType* dinDC_EVChargeParameterType) {
	int grammarID = 65;
	int done = 0;
	
	init_dinDC_EVChargeParameterType(dinDC_EVChargeParameterType);
	
	while(!done) {
		switch(grammarID) {
		case 65:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVStatus)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinDC_EVStatusType(stream, &dinDC_EVChargeParameterType->DC_EVStatus);
					grammarID = 66;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 66:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaximumCurrentLimit)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinPhysicalValueType(stream, &dinDC_EVChargeParameterType->EVMaximumCurrentLimit);
					grammarID = 67;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 67:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaximumVoltageLimit)] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinPhysicalValueType(stream, &dinDC_EVChargeParameterType->EVMaximumPowerLimit);
					dinDC_EVChargeParameterType->EVMaximumPowerLimit_isUsed = 1u;
					grammarID = 68;
					break;
				case 1:
					errn = decode_dinPhysicalValueType(stream, &dinDC_EVChargeParameterType->EVMaximumVoltageLimit);
					grammarID = 69;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 68:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaximumVoltageLimit)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinPhysicalValueType(stream, &dinDC_EVChargeParameterType->EVMaximumVoltageLimit);
					grammarID = 69;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 69:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVEnergyCapacity), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVEnergyRequest), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FullSOC), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkSOC), END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 3, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinPhysicalValueType(stream, &dinDC_EVChargeParameterType->EVEnergyCapacity);
					dinDC_EVChargeParameterType->EVEnergyCapacity_isUsed = 1u;
					grammarID = 70;
					break;
				case 1:
					errn = decode_dinPhysicalValueType(stream, &dinDC_EVChargeParameterType->EVEnergyRequest);
					dinDC_EVChargeParameterType->EVEnergyRequest_isUsed = 1u;
					grammarID = 71;
					break;
				case 2:
					/* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeNBitUnsignedInteger(stream, 7, &(uint32));
							dinDC_EVChargeParameterType->FullSOC = (int8_t)(uint32 + 0);
							dinDC_EVChargeParameterType->FullSOC_isUsed = 1u;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FullSOC) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 72;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 3:
					/* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeNBitUnsignedInteger(stream, 7, &(uint32));
							dinDC_EVChargeParameterType->BulkSOC = (int8_t)(uint32 + 0);
							dinDC_EVChargeParameterType->BulkSOC_isUsed = 1u;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkSOC) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 4;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 4:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 70:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVEnergyRequest), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FullSOC), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkSOC), END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 3, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinPhysicalValueType(stream, &dinDC_EVChargeParameterType->EVEnergyRequest);
					dinDC_EVChargeParameterType->EVEnergyRequest_isUsed = 1u;
					grammarID = 71;
					break;
				case 1:
					/* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeNBitUnsignedInteger(stream, 7, &(uint32));
							dinDC_EVChargeParameterType->FullSOC = (int8_t)(uint32 + 0);
							dinDC_EVChargeParameterType->FullSOC_isUsed = 1u;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FullSOC) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 72;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 2:
					/* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeNBitUnsignedInteger(stream, 7, &(uint32));
							dinDC_EVChargeParameterType->BulkSOC = (int8_t)(uint32 + 0);
							dinDC_EVChargeParameterType->BulkSOC_isUsed = 1u;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkSOC) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 4;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 3:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 71:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FullSOC), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkSOC), END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeNBitUnsignedInteger(stream, 7, &(uint32));
							dinDC_EVChargeParameterType->FullSOC = (int8_t)(uint32 + 0);
							dinDC_EVChargeParameterType->FullSOC_isUsed = 1u;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FullSOC) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 72;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 1:
					/* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeNBitUnsignedInteger(stream, 7, &(uint32));
							dinDC_EVChargeParameterType->BulkSOC = (int8_t)(uint32 + 0);
							dinDC_EVChargeParameterType->BulkSOC_isUsed = 1u;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkSOC) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 4;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 2:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 72:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkSOC), END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeNBitUnsignedInteger(stream, 7, &(uint32));
							dinDC_EVChargeParameterType->BulkSOC = (int8_t)(uint32 + 0);
							dinDC_EVChargeParameterType->BulkSOC_isUsed = 1u;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkSOC) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 4;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 1:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 4:
			/* Element[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SAScheduleListType',  base type name='SASchedulesType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("urn:iso:15118:2:2010:MsgDataTypes":SAScheduleTuple{1-UNBOUNDED})',  derivedBy='EXTENSION'.  */
static int decode_dinSAScheduleListType(bitstream_t* stream, struct dinSAScheduleListType* dinSAScheduleListType) {
	int grammarID = 73;
	int done = 0;
	
	init_dinSAScheduleListType(dinSAScheduleListType);
	
	while(!done) {
		switch(grammarID) {
		case 73:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleTuple)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					if (dinSAScheduleListType->SAScheduleTuple.arrayLen < dinSAScheduleListType_SAScheduleTuple_ARRAY_SIZE) {
						errn = decode_dinSAScheduleTupleType(stream, &dinSAScheduleListType->SAScheduleTuple.array[dinSAScheduleListType->SAScheduleTuple.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 74;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 74:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleTuple), END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					if (dinSAScheduleListType->SAScheduleTuple.arrayLen < dinSAScheduleListType_SAScheduleTuple_ARRAY_SIZE) {
						errn = decode_dinSAScheduleTupleType(stream, &dinSAScheduleListType->SAScheduleTuple.array[dinSAScheduleListType->SAScheduleTuple.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 74;
					break;
				case 1:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PMaxScheduleType',  base type name='anyType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("urn:iso:15118:2:2010:MsgDataTypes":PMaxScheduleID,"urn:iso:15118:2:2010:MsgDataTypes":PMaxScheduleEntry{1-UNBOUNDED})',  derivedBy='RESTRICTION'.  */
static int decode_dinPMaxScheduleType(bitstream_t* stream, struct dinPMaxScheduleType* dinPMaxScheduleType) {
	int grammarID = 75;
	int done = 0;
	
	init_dinPMaxScheduleType(dinPMaxScheduleType);
	
	while(!done) {
		switch(grammarID) {
		case 75:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMaxScheduleID)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[INTEGER]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeInteger16(stream, &dinPMaxScheduleType->PMaxScheduleID);
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMaxScheduleID) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 76;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 76:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMaxScheduleEntry)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					if (dinPMaxScheduleType->PMaxScheduleEntry.arrayLen < dinPMaxScheduleType_PMaxScheduleEntry_ARRAY_SIZE) {
						errn = decode_dinPMaxScheduleEntryType(stream, &dinPMaxScheduleType->PMaxScheduleEntry.array[dinPMaxScheduleType->PMaxScheduleEntry.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 77;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 77:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMaxScheduleEntry), END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					if (dinPMaxScheduleType->PMaxScheduleEntry.arrayLen < dinPMaxScheduleType_PMaxScheduleEntry_ARRAY_SIZE) {
						errn = decode_dinPMaxScheduleEntryType(stream, &dinPMaxScheduleType->PMaxScheduleEntry.array[dinPMaxScheduleType->PMaxScheduleEntry.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 77;
					break;
				case 1:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgBody,ServicePaymentSelectionReqType',  base type name='BodyBaseType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("urn:iso:15118:2:2010:MsgBody":SelectedPaymentOption,"urn:iso:15118:2:2010:MsgBody":SelectedServiceList)',  derivedBy='EXTENSION'.  */
static int decode_dinServicePaymentSelectionReqType(bitstream_t* stream, struct dinServicePaymentSelectionReqType* dinServicePaymentSelectionReqType) {
	int grammarID = 78;
	int done = 0;
	
	init_dinServicePaymentSelectionReqType(dinServicePaymentSelectionReqType);
	
	while(!done) {
		switch(grammarID) {
		case 78:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SelectedPaymentOption)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[ENUMERATION]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeNBitUnsignedInteger(stream, 1, &uint32);
							dinServicePaymentSelectionReqType->SelectedPaymentOption = (dinpaymentOptionType) uint32;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SelectedPaymentOption) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 79;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 79:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SelectedServiceList)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinSelectedServiceListType(stream, &dinServicePaymentSelectionReqType->SelectedServiceList);
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 4:
			/* Element[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,RelativeTimeIntervalType',  base type name='IntervalType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("urn:iso:15118:2:2010:MsgDataTypes":start,"urn:iso:15118:2:2010:MsgDataTypes":duration{0-1})',  derivedBy='EXTENSION'.  */
static int decode_dinRelativeTimeIntervalType(bitstream_t* stream, struct dinRelativeTimeIntervalType* dinRelativeTimeIntervalType) {
	int grammarID = 80;
	int done = 0;
	
	init_dinRelativeTimeIntervalType(dinRelativeTimeIntervalType);
	
	while(!done) {
		switch(grammarID) {
		case 80:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}start)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger32(stream, &dinRelativeTimeIntervalType->start);
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}start) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 81;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 81:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}duration), END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger32(stream, &dinRelativeTimeIntervalType->duration);
							dinRelativeTimeIntervalType->duration_isUsed = 1u;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}duration) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 4;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 1:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 4:
			/* Element[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EVStatusType',  base type name='anyType',  content type='EMPTY',  isAbstract='true',  hasTypeId='false',  final='0',  block='0',  derivedBy='RESTRICTION'.  */
static int decode_dinEVStatusType(bitstream_t* stream, struct dinEVStatusType* dinEVStatusType) {
	int grammarID = 64;
	int done = 0;
	
	init_dinEVStatusType(dinEVStatusType);
	
	while(!done) {
		switch(grammarID) {
		case 64:
			/* FirstStartTag[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgBody,PreChargeResType',  base type name='BodyBaseType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2010:MsgBody":EVSEPresentVoltage)',  derivedBy='EXTENSION'.  */
static int decode_dinPreChargeResType(bitstream_t* stream, struct dinPreChargeResType* dinPreChargeResType) {
	int grammarID = 13;
	int done = 0;
	
	init_dinPreChargeResType(dinPreChargeResType);
	
	while(!done) {
		switch(grammarID) {
		case 13:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[ENUMERATION]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeNBitUnsignedInteger(stream, 5, &uint32);
							dinPreChargeResType->ResponseCode = (dinresponseCodeType) uint32;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 14;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 14:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVSEStatus)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinDC_EVSEStatusType(stream, &dinPreChargeResType->DC_EVSEStatus);
					grammarID = 15;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 15:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEPresentVoltage)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinPhysicalValueType(stream, &dinPreChargeResType->EVSEPresentVoltage);
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 4:
			/* Element[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVSEChargeParameterType',  base type name='EVSEChargeParameterType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("urn:iso:15118:2:2010:MsgDataTypes":DC_EVSEStatus,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMaximumCurrentLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMaximumPowerLimit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVSEMaximumVoltageLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMinimumCurrentLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMinimumVoltageLimit,"urn:iso:15118:2:2010:MsgDataTypes":EVSECurrentRegulationTolerance{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVSEPeakCurrentRipple,"urn:iso:15118:2:2010:MsgDataTypes":EVSEEnergyToBeDelivered{0-1})',  derivedBy='EXTENSION'.  */
static int decode_dinDC_EVSEChargeParameterType(bitstream_t* stream, struct dinDC_EVSEChargeParameterType* dinDC_EVSEChargeParameterType) {
	int grammarID = 82;
	int done = 0;
	
	init_dinDC_EVSEChargeParameterType(dinDC_EVSEChargeParameterType);
	
	while(!done) {
		switch(grammarID) {
		case 82:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVSEStatus)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinDC_EVSEStatusType(stream, &dinDC_EVSEChargeParameterType->DC_EVSEStatus);
					grammarID = 83;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 83:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaximumCurrentLimit)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEMaximumCurrentLimit);
					grammarID = 84;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 84:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaximumVoltageLimit)] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEMaximumPowerLimit);
					dinDC_EVSEChargeParameterType->EVSEMaximumPowerLimit_isUsed = 1u;
					grammarID = 85;
					break;
				case 1:
					errn = decode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEMaximumVoltageLimit);
					grammarID = 86;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 85:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaximumVoltageLimit)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEMaximumVoltageLimit);
					grammarID = 86;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 86:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMinimumCurrentLimit)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEMinimumCurrentLimit);
					grammarID = 87;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 87:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMinimumVoltageLimit)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEMinimumVoltageLimit);
					grammarID = 88;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 88:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSECurrentRegulationTolerance), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEPeakCurrentRipple)] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSECurrentRegulationTolerance);
					dinDC_EVSEChargeParameterType->EVSECurrentRegulationTolerance_isUsed = 1u;
					grammarID = 89;
					break;
				case 1:
					errn = decode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEPeakCurrentRipple);
					grammarID = 90;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 89:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEPeakCurrentRipple)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEPeakCurrentRipple);
					grammarID = 90;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 90:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEEnergyToBeDelivered), END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinPhysicalValueType(stream, &dinDC_EVSEChargeParameterType->EVSEEnergyToBeDelivered);
					dinDC_EVSEChargeParameterType->EVSEEnergyToBeDelivered_isUsed = 1u;
					grammarID = 4;
					break;
				case 1:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 4:
			/* Element[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgBody,PaymentDetailsResType',  base type name='BodyBaseType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":GenChallenge,"urn:iso:15118:2:2010:MsgBody":DateTimeNow)',  derivedBy='EXTENSION'.  */
static int decode_dinPaymentDetailsResType(bitstream_t* stream, struct dinPaymentDetailsResType* dinPaymentDetailsResType) {
	int grammarID = 91;
	int done = 0;
	
	init_dinPaymentDetailsResType(dinPaymentDetailsResType);
	
	while(!done) {
		switch(grammarID) {
		case 91:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[ENUMERATION]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeNBitUnsignedInteger(stream, 5, &uint32);
							dinPaymentDetailsResType->ResponseCode = (dinresponseCodeType) uint32;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 92;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 92:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}GenChallenge)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[STRING]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger16(stream, &dinPaymentDetailsResType->GenChallenge.charactersLen);
							if (errn == 0) {
								if (dinPaymentDetailsResType->GenChallenge.charactersLen >= 2) {
									dinPaymentDetailsResType->GenChallenge.charactersLen = (uint16_t)(dinPaymentDetailsResType->GenChallenge.charactersLen - 2); /* string table miss */
									errn = decodeCharacters(stream, dinPaymentDetailsResType->GenChallenge.charactersLen, dinPaymentDetailsResType->GenChallenge.characters, dinPaymentDetailsResType_GenChallenge_CHARACTERS_SIZE);
								} else {
									/* string table hit */
									errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
								}
							}
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}GenChallenge) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 93;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 93:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DateTimeNow)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeInteger64(stream, &dinPaymentDetailsResType->DateTimeNow);
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DateTimeNow) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 4;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 4:
			/* Element[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='http://www.w3.org/2000/09/xmldsig#,DSAKeyValueType',  base type name='anyType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='(("http://www.w3.org/2000/09/xmldsig#":P,"http://www.w3.org/2000/09/xmldsig#":Q){0-1},"http://www.w3.org/2000/09/xmldsig#":G{0-1},"http://www.w3.org/2000/09/xmldsig#":Y,"http://www.w3.org/2000/09/xmldsig#":J{0-1},("http://www.w3.org/2000/09/xmldsig#":Seed,"http://www.w3.org/2000/09/xmldsig#":PgenCounter){0-1})',  derivedBy='RESTRICTION'.  */
static int decode_dinDSAKeyValueType(bitstream_t* stream, struct dinDSAKeyValueType* dinDSAKeyValueType) {
	int grammarID = 94;
	int done = 0;
	
	init_dinDSAKeyValueType(dinDSAKeyValueType);
	
	while(!done) {
		switch(grammarID) {
		case 94:
			/* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}P), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y)] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[BINARY_BASE64]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger16(stream, &dinDSAKeyValueType->P.bytesLen);
							if (errn == 0) {
								errn =  (dinDSAKeyValueType->P.bytesLen) <= dinDSAKeyValueType_P_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
							}
							if (errn == 0) {
								errn = decodeBytes(stream, dinDSAKeyValueType->P.bytesLen, dinDSAKeyValueType->P.bytes);
							}
							dinDSAKeyValueType->P_isUsed = 1u;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}P) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 95;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 1:
					/* FirstStartTag[CHARACTERS[BINARY_BASE64]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger16(stream, &dinDSAKeyValueType->G.bytesLen);
							if (errn == 0) {
								errn =  (dinDSAKeyValueType->G.bytesLen) <= dinDSAKeyValueType_G_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
							}
							if (errn == 0) {
								errn = decodeBytes(stream, dinDSAKeyValueType->G.bytesLen, dinDSAKeyValueType->G.bytes);
							}
							dinDSAKeyValueType->G_isUsed = 1u;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 96;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 2:
					/* FirstStartTag[CHARACTERS[BINARY_BASE64]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger16(stream, &dinDSAKeyValueType->Y.bytesLen);
							if (errn == 0) {
								errn =  (dinDSAKeyValueType->Y.bytesLen) <= dinDSAKeyValueType_Y_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
							}
							if (errn == 0) {
								errn = decodeBytes(stream, dinDSAKeyValueType->Y.bytesLen, dinDSAKeyValueType->Y.bytes);
							}
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 97;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 95:
			/* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Q)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[BINARY_BASE64]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger16(stream, &dinDSAKeyValueType->Q.bytesLen);
							if (errn == 0) {
								errn =  (dinDSAKeyValueType->Q.bytesLen) <= dinDSAKeyValueType_Q_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
							}
							if (errn == 0) {
								errn = decodeBytes(stream, dinDSAKeyValueType->Q.bytesLen, dinDSAKeyValueType->Q.bytes);
							}
							dinDSAKeyValueType->Q_isUsed = 1u;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Q) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 98;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 98:
			/* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y)] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[BINARY_BASE64]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger16(stream, &dinDSAKeyValueType->G.bytesLen);
							if (errn == 0) {
								errn =  (dinDSAKeyValueType->G.bytesLen) <= dinDSAKeyValueType_G_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
							}
							if (errn == 0) {
								errn = decodeBytes(stream, dinDSAKeyValueType->G.bytesLen, dinDSAKeyValueType->G.bytes);
							}
							dinDSAKeyValueType->G_isUsed = 1u;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 96;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 1:
					/* FirstStartTag[CHARACTERS[BINARY_BASE64]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger16(stream, &dinDSAKeyValueType->Y.bytesLen);
							if (errn == 0) {
								errn =  (dinDSAKeyValueType->Y.bytesLen) <= dinDSAKeyValueType_Y_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
							}
							if (errn == 0) {
								errn = decodeBytes(stream, dinDSAKeyValueType->Y.bytesLen, dinDSAKeyValueType->Y.bytes);
							}
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 97;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 96:
			/* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[BINARY_BASE64]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger16(stream, &dinDSAKeyValueType->Y.bytesLen);
							if (errn == 0) {
								errn =  (dinDSAKeyValueType->Y.bytesLen) <= dinDSAKeyValueType_Y_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
							}
							if (errn == 0) {
								errn = decodeBytes(stream, dinDSAKeyValueType->Y.bytesLen, dinDSAKeyValueType->Y.bytes);
							}
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 97;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 97:
			/* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}J), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed), END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[BINARY_BASE64]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger16(stream, &dinDSAKeyValueType->J.bytesLen);
							if (errn == 0) {
								errn =  (dinDSAKeyValueType->J.bytesLen) <= dinDSAKeyValueType_J_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
							}
							if (errn == 0) {
								errn = decodeBytes(stream, dinDSAKeyValueType->J.bytesLen, dinDSAKeyValueType->J.bytes);
							}
							dinDSAKeyValueType->J_isUsed = 1u;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}J) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 99;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 1:
					/* FirstStartTag[CHARACTERS[BINARY_BASE64]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger16(stream, &dinDSAKeyValueType->Seed.bytesLen);
							if (errn == 0) {
								errn =  (dinDSAKeyValueType->Seed.bytesLen) <= dinDSAKeyValueType_Seed_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
							}
							if (errn == 0) {
								errn = decodeBytes(stream, dinDSAKeyValueType->Seed.bytesLen, dinDSAKeyValueType->Seed.bytes);
							}
							dinDSAKeyValueType->Seed_isUsed = 1u;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 100;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 2:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 99:
			/* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed), END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[BINARY_BASE64]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger16(stream, &dinDSAKeyValueType->Seed.bytesLen);
							if (errn == 0) {
								errn =  (dinDSAKeyValueType->Seed.bytesLen) <= dinDSAKeyValueType_Seed_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
							}
							if (errn == 0) {
								errn = decodeBytes(stream, dinDSAKeyValueType->Seed.bytesLen, dinDSAKeyValueType->Seed.bytes);
							}
							dinDSAKeyValueType->Seed_isUsed = 1u;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 100;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 1:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 100:
			/* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PgenCounter)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[BINARY_BASE64]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger16(stream, &dinDSAKeyValueType->PgenCounter.bytesLen);
							if (errn == 0) {
								errn =  (dinDSAKeyValueType->PgenCounter.bytesLen) <= dinDSAKeyValueType_PgenCounter_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
							}
							if (errn == 0) {
								errn = decodeBytes(stream, dinDSAKeyValueType->PgenCounter.bytesLen, dinDSAKeyValueType->PgenCounter.bytes);
							}
							dinDSAKeyValueType->PgenCounter_isUsed = 1u;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PgenCounter) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 4;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 4:
			/* Element[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SASchedulesType',  base type name='anyType',  content type='EMPTY',  isAbstract='true',  hasTypeId='false',  final='0',  block='0',  derivedBy='RESTRICTION'.  */
static int decode_dinSASchedulesType(bitstream_t* stream, struct dinSASchedulesType* dinSASchedulesType) {
	int grammarID = 64;
	int done = 0;
	
	init_dinSASchedulesType(dinSASchedulesType);
	
	while(!done) {
		switch(grammarID) {
		case 64:
			/* FirstStartTag[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgBody,CertificateUpdateResType',  base type name='BodyBaseType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":ContractSignatureCertChain,"urn:iso:15118:2:2010:MsgBody":ContractSignatureEncryptedPrivateKey,"urn:iso:15118:2:2010:MsgBody":DHParams,"urn:iso:15118:2:2010:MsgBody":ContractID,"urn:iso:15118:2:2010:MsgBody":RetryCounter)',  derivedBy='EXTENSION'.  */
static int decode_dinCertificateUpdateResType(bitstream_t* stream, struct dinCertificateUpdateResType* dinCertificateUpdateResType) {
	int grammarID = 101;
	int done = 0;
	
	init_dinCertificateUpdateResType(dinCertificateUpdateResType);
	
	while(!done) {
		switch(grammarID) {
		case 101:
			/* FirstStartTag[ATTRIBUTE[STRING](Id)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decodeUnsignedInteger16(stream, &dinCertificateUpdateResType->Id.charactersLen);
					if (errn == 0) {
						if (dinCertificateUpdateResType->Id.charactersLen >= 2) {
							dinCertificateUpdateResType->Id.charactersLen = (uint16_t)(dinCertificateUpdateResType->Id.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, dinCertificateUpdateResType->Id.charactersLen, dinCertificateUpdateResType->Id.characters, dinCertificateUpdateResType_Id_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					grammarID = 102;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 102:
			/* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[ENUMERATION]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeNBitUnsignedInteger(stream, 5, &uint32);
							dinCertificateUpdateResType->ResponseCode = (dinresponseCodeType) uint32;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 103;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 103:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureCertChain)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinCertificateChainType(stream, &dinCertificateUpdateResType->ContractSignatureCertChain);
					grammarID = 104;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 104:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureEncryptedPrivateKey)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[BINARY_BASE64]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger16(stream, &dinCertificateUpdateResType->ContractSignatureEncryptedPrivateKey.bytesLen);
							if (errn == 0) {
								errn =  (dinCertificateUpdateResType->ContractSignatureEncryptedPrivateKey.bytesLen) <= dinCertificateUpdateResType_ContractSignatureEncryptedPrivateKey_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
							}
							if (errn == 0) {
								errn = decodeBytes(stream, dinCertificateUpdateResType->ContractSignatureEncryptedPrivateKey.bytesLen, dinCertificateUpdateResType->ContractSignatureEncryptedPrivateKey.bytes);
							}
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureEncryptedPrivateKey) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 105;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 105:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DHParams)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[BINARY_BASE64]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger16(stream, &dinCertificateUpdateResType->DHParams.bytesLen);
							if (errn == 0) {
								errn =  (dinCertificateUpdateResType->DHParams.bytesLen) <= dinCertificateUpdateResType_DHParams_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
							}
							if (errn == 0) {
								errn = decodeBytes(stream, dinCertificateUpdateResType->DHParams.bytesLen, dinCertificateUpdateResType->DHParams.bytes);
							}
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DHParams) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 106;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 106:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractID)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[STRING]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger16(stream, &dinCertificateUpdateResType->ContractID.charactersLen);
							if (errn == 0) {
								if (dinCertificateUpdateResType->ContractID.charactersLen >= 2) {
									dinCertificateUpdateResType->ContractID.charactersLen = (uint16_t)(dinCertificateUpdateResType->ContractID.charactersLen - 2); /* string table miss */
									errn = decodeCharacters(stream, dinCertificateUpdateResType->ContractID.charactersLen, dinCertificateUpdateResType->ContractID.characters, dinCertificateUpdateResType_ContractID_CHARACTERS_SIZE);
								} else {
									/* string table hit */
									errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
								}
							}
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractID) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 107;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 107:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}RetryCounter)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeInteger16(stream, &dinCertificateUpdateResType->RetryCounter);
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}RetryCounter) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 4;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 4:
			/* Element[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EVChargeParameterType',  base type name='anyType',  content type='EMPTY',  isAbstract='true',  hasTypeId='false',  final='0',  block='0',  derivedBy='RESTRICTION'.  */
static int decode_dinEVChargeParameterType(bitstream_t* stream, struct dinEVChargeParameterType* dinEVChargeParameterType) {
	int grammarID = 64;
	int done = 0;
	
	init_dinEVChargeParameterType(dinEVChargeParameterType);
	
	while(!done) {
		switch(grammarID) {
		case 64:
			/* FirstStartTag[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgHeader,MessageHeaderType',  base type name='anyType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("urn:iso:15118:2:2010:MsgHeader":SessionID,"urn:iso:15118:2:2010:MsgHeader":Notification{0-1},"http://www.w3.org/2000/09/xmldsig#":Signature{0-1})',  derivedBy='RESTRICTION'.  */
static int decode_dinMessageHeaderType(bitstream_t* stream, struct dinMessageHeaderType* dinMessageHeaderType) {
	int grammarID = 108;
	int done = 0;
	
	init_dinMessageHeaderType(dinMessageHeaderType);
	
	while(!done) {
		switch(grammarID) {
		case 108:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgHeader}SessionID)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[BINARY_HEX]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger16(stream, &dinMessageHeaderType->SessionID.bytesLen);
							if (errn == 0) {
								errn =  (dinMessageHeaderType->SessionID.bytesLen) <= dinMessageHeaderType_SessionID_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
							}
							if (errn == 0) {
								errn = decodeBytes(stream, dinMessageHeaderType->SessionID.bytesLen, dinMessageHeaderType->SessionID.bytes);
							}
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgHeader}SessionID) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 109;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 109:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgHeader}Notification), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Signature), END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinNotificationType(stream, &dinMessageHeaderType->Notification);
					dinMessageHeaderType->Notification_isUsed = 1u;
					grammarID = 110;
					break;
				case 1:
					errn = decode_dinSignatureType(stream, &dinMessageHeaderType->Signature);
					dinMessageHeaderType->Signature_isUsed = 1u;
					grammarID = 4;
					break;
				case 2:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 110:
			/* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Signature), END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinSignatureType(stream, &dinMessageHeaderType->Signature);
					dinMessageHeaderType->Signature_isUsed = 1u;
					grammarID = 4;
					break;
				case 1:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 4:
			/* Element[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgDef,BodyBaseType',  base type name='anyType',  content type='EMPTY',  isAbstract='true',  hasTypeId='false',  final='0',  block='0',  derivedBy='RESTRICTION'.  */
static int decode_dinBodyBaseType(bitstream_t* stream, struct dinBodyBaseType* dinBodyBaseType) {
	int grammarID = 64;
	int done = 0;
	
	init_dinBodyBaseType(dinBodyBaseType);
	
	while(!done) {
		switch(grammarID) {
		case 64:
			/* FirstStartTag[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='http://www.w3.org/2000/09/xmldsig#,KeyValueType',  base type name='anyType',  content type='MIXED',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("http://www.w3.org/2000/09/xmldsig#":DSAKeyValue|"http://www.w3.org/2000/09/xmldsig#":RSAKeyValue|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]))',  derivedBy='RESTRICTION'.  */
static int decode_dinKeyValueType(bitstream_t* stream, struct dinKeyValueType* dinKeyValueType) {
	int grammarID = 111;
	int done = 0;
	
	init_dinKeyValueType(dinKeyValueType);
	
	while(!done) {
		switch(grammarID) {
		case 111:
			/* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DSAKeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RSAKeyValue), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */
			errn = decodeNBitUnsignedInteger(stream, 3, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinDSAKeyValueType(stream, &dinKeyValueType->DSAKeyValue);
					dinKeyValueType->DSAKeyValue_isUsed = 1u;
					grammarID = 112;
					break;
				case 1:
					errn = decode_dinRSAKeyValueType(stream, &dinKeyValueType->RSAKeyValue);
					dinKeyValueType->RSAKeyValue_isUsed = 1u;
					grammarID = 112;
					break;
				case 2:
					errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					/* TODO unsupported event : START_ELEMENT_GENERIC */
					grammarID = 112;
					break;
				case 3:
					errn = decodeUnsignedInteger16(stream, &dinKeyValueType->ANY.charactersLen);
					if (errn == 0) {
						if (dinKeyValueType->ANY.charactersLen >= 2) {
							dinKeyValueType->ANY.charactersLen = (uint16_t)(dinKeyValueType->ANY.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, dinKeyValueType->ANY.charactersLen, dinKeyValueType->ANY.characters, dinKeyValueType_ANY_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					dinKeyValueType->ANY_isUsed = 1u;
					grammarID = 113;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 112:
			/* Element[END_ELEMENT, CHARACTERS_GENERIC[STRING]] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				case 1:
					errn = decodeUnsignedInteger16(stream, &dinKeyValueType->ANY.charactersLen);
					if (errn == 0) {
						if (dinKeyValueType->ANY.charactersLen >= 2) {
							dinKeyValueType->ANY.charactersLen = (uint16_t)(dinKeyValueType->ANY.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, dinKeyValueType->ANY.charactersLen, dinKeyValueType->ANY.characters, dinKeyValueType_ANY_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					dinKeyValueType->ANY_isUsed = 1u;
					grammarID = 112;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 113:
			/* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DSAKeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RSAKeyValue), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */
			errn = decodeNBitUnsignedInteger(stream, 3, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinDSAKeyValueType(stream, &dinKeyValueType->DSAKeyValue);
					dinKeyValueType->DSAKeyValue_isUsed = 1u;
					grammarID = 112;
					break;
				case 1:
					errn = decode_dinRSAKeyValueType(stream, &dinKeyValueType->RSAKeyValue);
					dinKeyValueType->RSAKeyValue_isUsed = 1u;
					grammarID = 112;
					break;
				case 2:
					errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					/* TODO unsupported event : START_ELEMENT_GENERIC */
					grammarID = 112;
					break;
				case 3:
					errn = decodeUnsignedInteger16(stream, &dinKeyValueType->ANY.charactersLen);
					if (errn == 0) {
						if (dinKeyValueType->ANY.charactersLen >= 2) {
							dinKeyValueType->ANY.charactersLen = (uint16_t)(dinKeyValueType->ANY.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, dinKeyValueType->ANY.charactersLen, dinKeyValueType->ANY.characters, dinKeyValueType_ANY_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					dinKeyValueType->ANY_isUsed = 1u;
					grammarID = 113;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,IntervalType',  base type name='anyType',  content type='EMPTY',  isAbstract='true',  hasTypeId='false',  final='0',  block='0',  derivedBy='RESTRICTION'.  */
static int decode_dinIntervalType(bitstream_t* stream, struct dinIntervalType* dinIntervalType) {
	int grammarID = 64;
	int done = 0;
	
	init_dinIntervalType(dinIntervalType);
	
	while(!done) {
		switch(grammarID) {
		case 64:
			/* FirstStartTag[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgBody,ChargeParameterDiscoveryResType',  base type name='BodyBaseType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":EVSEProcessing,"urn:iso:15118:2:2010:MsgDataTypes":SASchedules,"urn:iso:15118:2:2010:MsgDataTypes":EVSEChargeParameter)',  derivedBy='EXTENSION'.  */
static int decode_dinChargeParameterDiscoveryResType(bitstream_t* stream, struct dinChargeParameterDiscoveryResType* dinChargeParameterDiscoveryResType) {
	int grammarID = 114;
	int done = 0;
	
	init_dinChargeParameterDiscoveryResType(dinChargeParameterDiscoveryResType);
	
	while(!done) {
		switch(grammarID) {
		case 114:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[ENUMERATION]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeNBitUnsignedInteger(stream, 5, &uint32);
							dinChargeParameterDiscoveryResType->ResponseCode = (dinresponseCodeType) uint32;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 115;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 115:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEProcessing)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[ENUMERATION]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeNBitUnsignedInteger(stream, 1, &uint32);
							dinChargeParameterDiscoveryResType->EVSEProcessing = (dinEVSEProcessingType) uint32;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEProcessing) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 116;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 116:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleList), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SASchedules)] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinSAScheduleListType(stream, &dinChargeParameterDiscoveryResType->SAScheduleList);
					dinChargeParameterDiscoveryResType->SAScheduleList_isUsed = 1u;
					grammarID = 117;
					break;
				case 1:
					errn = decode_dinSASchedulesType(stream, &dinChargeParameterDiscoveryResType->SASchedules);
					dinChargeParameterDiscoveryResType->SASchedules_isUsed = 1u;
					grammarID = 117;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 117:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEChargeParameter)] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinAC_EVSEChargeParameterType(stream, &dinChargeParameterDiscoveryResType->AC_EVSEChargeParameter);
					dinChargeParameterDiscoveryResType->AC_EVSEChargeParameter_isUsed = 1u;
					grammarID = 4;
					break;
				case 1:
					errn = decode_dinDC_EVSEChargeParameterType(stream, &dinChargeParameterDiscoveryResType->DC_EVSEChargeParameter);
					dinChargeParameterDiscoveryResType->DC_EVSEChargeParameter_isUsed = 1u;
					grammarID = 4;
					break;
				case 2:
					errn = decode_dinEVSEChargeParameterType(stream, &dinChargeParameterDiscoveryResType->EVSEChargeParameter);
					dinChargeParameterDiscoveryResType->EVSEChargeParameter_isUsed = 1u;
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 4:
			/* Element[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgBody,PowerDeliveryReqType',  base type name='BodyBaseType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("urn:iso:15118:2:2010:MsgBody":ReadyToChargeState,"urn:iso:15118:2:2010:MsgBody":ChargingProfile{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVPowerDeliveryParameter{0-1})',  derivedBy='EXTENSION'.  */
static int decode_dinPowerDeliveryReqType(bitstream_t* stream, struct dinPowerDeliveryReqType* dinPowerDeliveryReqType) {
	int grammarID = 118;
	int done = 0;
	
	init_dinPowerDeliveryReqType(dinPowerDeliveryReqType);
	
	while(!done) {
		switch(grammarID) {
		case 118:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReadyToChargeState)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[BOOLEAN]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeBoolean(stream, &dinPowerDeliveryReqType->ReadyToChargeState);
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReadyToChargeState) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 119;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 119:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingProfile), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVPowerDeliveryParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVPowerDeliveryParameter), END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 3, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinChargingProfileType(stream, &dinPowerDeliveryReqType->ChargingProfile);
					dinPowerDeliveryReqType->ChargingProfile_isUsed = 1u;
					grammarID = 120;
					break;
				case 1:
					errn = decode_dinDC_EVPowerDeliveryParameterType(stream, &dinPowerDeliveryReqType->DC_EVPowerDeliveryParameter);
					dinPowerDeliveryReqType->DC_EVPowerDeliveryParameter_isUsed = 1u;
					grammarID = 4;
					break;
				case 2:
					errn = decode_dinEVPowerDeliveryParameterType(stream, &dinPowerDeliveryReqType->EVPowerDeliveryParameter);
					dinPowerDeliveryReqType->EVPowerDeliveryParameter_isUsed = 1u;
					grammarID = 4;
					break;
				case 3:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 120:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVPowerDeliveryParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVPowerDeliveryParameter), END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinDC_EVPowerDeliveryParameterType(stream, &dinPowerDeliveryReqType->DC_EVPowerDeliveryParameter);
					dinPowerDeliveryReqType->DC_EVPowerDeliveryParameter_isUsed = 1u;
					grammarID = 4;
					break;
				case 1:
					errn = decode_dinEVPowerDeliveryParameterType(stream, &dinPowerDeliveryReqType->EVPowerDeliveryParameter);
					dinPowerDeliveryReqType->EVPowerDeliveryParameter_isUsed = 1u;
					grammarID = 4;
					break;
				case 2:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 4:
			/* Element[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,CertificateChainType',  base type name='anyType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("urn:iso:15118:2:2010:MsgDataTypes":Certificate,"urn:iso:15118:2:2010:MsgDataTypes":SubCertificates{0-1})',  derivedBy='RESTRICTION'.  */
static int decode_dinCertificateChainType(bitstream_t* stream, struct dinCertificateChainType* dinCertificateChainType) {
	int grammarID = 121;
	int done = 0;
	
	init_dinCertificateChainType(dinCertificateChainType);
	
	while(!done) {
		switch(grammarID) {
		case 121:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Certificate)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[BINARY_BASE64]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger16(stream, &dinCertificateChainType->Certificate.bytesLen);
							if (errn == 0) {
								errn =  (dinCertificateChainType->Certificate.bytesLen) <= dinCertificateChainType_Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
							}
							if (errn == 0) {
								errn = decodeBytes(stream, dinCertificateChainType->Certificate.bytesLen, dinCertificateChainType->Certificate.bytes);
							}
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Certificate) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 122;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 122:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SubCertificates), END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinSubCertificatesType(stream, &dinCertificateChainType->SubCertificates);
					dinCertificateChainType->SubCertificates_isUsed = 1u;
					grammarID = 4;
					break;
				case 1:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 4:
			/* Element[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='http://www.w3.org/2000/09/xmldsig#,TransformsType',  base type name='anyType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("http://www.w3.org/2000/09/xmldsig#":Transform{1-UNBOUNDED})',  derivedBy='RESTRICTION'.  */
static int decode_dinTransformsType(bitstream_t* stream, struct dinTransformsType* dinTransformsType) {
	int grammarID = 123;
	int done = 0;
	
	init_dinTransformsType(dinTransformsType);
	
	while(!done) {
		switch(grammarID) {
		case 123:
			/* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					if (dinTransformsType->Transform.arrayLen < dinTransformsType_Transform_ARRAY_SIZE) {
						errn = decode_dinTransformType(stream, &dinTransformsType->Transform.array[dinTransformsType->Transform.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 124;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 124:
			/* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform), END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					if (dinTransformsType->Transform.arrayLen < dinTransformsType_Transform_ARRAY_SIZE) {
						errn = decode_dinTransformType(stream, &dinTransformsType->Transform.array[dinTransformsType->Transform.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 124;
					break;
				case 1:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EntryType',  base type name='anyType',  content type='ELEMENT',  isAbstract='true',  hasTypeId='false',  final='0',  block='0',  particle='("urn:iso:15118:2:2010:MsgDataTypes":TimeInterval)',  derivedBy='RESTRICTION'.  */
static int decode_dinEntryType(bitstream_t* stream, struct dinEntryType* dinEntryType) {
	int grammarID = 125;
	int done = 0;
	
	init_dinEntryType(dinEntryType);
	
	while(!done) {
		switch(grammarID) {
		case 125:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RelativeTimeInterval), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TimeInterval)] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinRelativeTimeIntervalType(stream, &dinEntryType->RelativeTimeInterval);
					dinEntryType->RelativeTimeInterval_isUsed = 1u;
					grammarID = 4;
					break;
				case 1:
					errn = decode_dinIntervalType(stream, &dinEntryType->TimeInterval);
					dinEntryType->TimeInterval_isUsed = 1u;
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 4:
			/* Element[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgBody,SessionStopType',  base type name='BodyBaseType',  content type='EMPTY',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  derivedBy='EXTENSION'.  */
static int decode_dinSessionStopType(bitstream_t* stream, struct dinSessionStopType* dinSessionStopType) {
	int grammarID = 64;
	int done = 0;
	
	init_dinSessionStopType(dinSessionStopType);
	
	while(!done) {
		switch(grammarID) {
		case 64:
			/* FirstStartTag[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgBody,ServiceDetailReqType',  base type name='BodyBaseType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("urn:iso:15118:2:2010:MsgBody":ServiceID)',  derivedBy='EXTENSION'.  */
static int decode_dinServiceDetailReqType(bitstream_t* stream, struct dinServiceDetailReqType* dinServiceDetailReqType) {
	int grammarID = 126;
	int done = 0;
	
	init_dinServiceDetailReqType(dinServiceDetailReqType);
	
	while(!done) {
		switch(grammarID) {
		case 126:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceID)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger16(stream, &dinServiceDetailReqType->ServiceID);
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceID) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 4;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 4:
			/* Element[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='http://www.w3.org/2000/09/xmldsig#,DigestMethodType',  base type name='anyType',  content type='MIXED',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})',  derivedBy='RESTRICTION'.  */
static int decode_dinDigestMethodType(bitstream_t* stream, struct dinDigestMethodType* dinDigestMethodType) {
	int grammarID = 18;
	int done = 0;
	
	init_dinDigestMethodType(dinDigestMethodType);
	
	while(!done) {
		switch(grammarID) {
		case 18:
			/* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decodeUnsignedInteger16(stream, &dinDigestMethodType->Algorithm.charactersLen);
					if (errn == 0) {
						if (dinDigestMethodType->Algorithm.charactersLen >= 2) {
							dinDigestMethodType->Algorithm.charactersLen = (uint16_t)(dinDigestMethodType->Algorithm.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, dinDigestMethodType->Algorithm.charactersLen, dinDigestMethodType->Algorithm.characters, dinDigestMethodType_Algorithm_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					grammarID = 19;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 19:
			/* StartTag[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					/* TODO unsupported event : START_ELEMENT_GENERIC */
					grammarID = 20;
					break;
				case 1:
					done = 1;
					grammarID = 5;
					break;
				case 2:
					errn = decodeUnsignedInteger16(stream, &dinDigestMethodType->ANY.charactersLen);
					if (errn == 0) {
						if (dinDigestMethodType->ANY.charactersLen >= 2) {
							dinDigestMethodType->ANY.charactersLen = (uint16_t)(dinDigestMethodType->ANY.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, dinDigestMethodType->ANY.charactersLen, dinDigestMethodType->ANY.characters, dinDigestMethodType_ANY_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					dinDigestMethodType->ANY_isUsed = 1u;
					grammarID = 20;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 20:
			/* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					/* TODO unsupported event : START_ELEMENT_GENERIC */
					grammarID = 20;
					break;
				case 1:
					done = 1;
					grammarID = 5;
					break;
				case 2:
					errn = decodeUnsignedInteger16(stream, &dinDigestMethodType->ANY.charactersLen);
					if (errn == 0) {
						if (dinDigestMethodType->ANY.charactersLen >= 2) {
							dinDigestMethodType->ANY.charactersLen = (uint16_t)(dinDigestMethodType->ANY.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, dinDigestMethodType->ANY.charactersLen, dinDigestMethodType->ANY.characters, dinDigestMethodType_ANY_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					dinDigestMethodType->ANY_isUsed = 1u;
					grammarID = 20;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ParameterType',  base type name='anyType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("urn:iso:15118:2:2010:MsgDataTypes":boolValue|"urn:iso:15118:2:2010:MsgDataTypes":byteValue|"urn:iso:15118:2:2010:MsgDataTypes":shortValue|"urn:iso:15118:2:2010:MsgDataTypes":intValue|"urn:iso:15118:2:2010:MsgDataTypes":physicalValue|"urn:iso:15118:2:2010:MsgDataTypes":stringValue)',  derivedBy='RESTRICTION'.  */
static int decode_dinParameterType(bitstream_t* stream, struct dinParameterType* dinParameterType) {
	int grammarID = 127;
	int done = 0;
	
	init_dinParameterType(dinParameterType);
	
	while(!done) {
		switch(grammarID) {
		case 127:
			/* FirstStartTag[ATTRIBUTE[STRING](Name)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decodeUnsignedInteger16(stream, &dinParameterType->Name.charactersLen);
					if (errn == 0) {
						if (dinParameterType->Name.charactersLen >= 2) {
							dinParameterType->Name.charactersLen = (uint16_t)(dinParameterType->Name.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, dinParameterType->Name.charactersLen, dinParameterType->Name.characters, dinParameterType_Name_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					grammarID = 128;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 128:
			/* StartTag[ATTRIBUTE[ENUMERATION](ValueType)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decodeNBitUnsignedInteger(stream, 3, &uint32);
					dinParameterType->ValueType = (dinvalueType) uint32;
					grammarID = 129;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 129:
			/* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}boolValue), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}byteValue), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}shortValue), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}intValue), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}physicalValue), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}stringValue)] */
			errn = decodeNBitUnsignedInteger(stream, 3, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[BOOLEAN]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeBoolean(stream, &dinParameterType->boolValue);
							dinParameterType->boolValue_isUsed = 1u;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}boolValue) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 4;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 1:
					/* First(xsi:type)StartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeNBitUnsignedInteger(stream, 8, &(uint32));
							dinParameterType->byteValue = (int8_t)(uint32 -128);
							dinParameterType->byteValue_isUsed = 1u;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}byteValue) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 4;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 2:
					/* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeInteger16(stream, &dinParameterType->shortValue);
							dinParameterType->shortValue_isUsed = 1u;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}shortValue) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 4;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 3:
					/* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeInteger32(stream, &dinParameterType->intValue);
							dinParameterType->intValue_isUsed = 1u;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}intValue) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 4;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 4:
					errn = decode_dinPhysicalValueType(stream, &dinParameterType->physicalValue);
					dinParameterType->physicalValue_isUsed = 1u;
					grammarID = 4;
					break;
				case 5:
					/* First(xsi:type)StartTag[CHARACTERS[STRING]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger16(stream, &dinParameterType->stringValue.charactersLen);
							if (errn == 0) {
								if (dinParameterType->stringValue.charactersLen >= 2) {
									dinParameterType->stringValue.charactersLen = (uint16_t)(dinParameterType->stringValue.charactersLen - 2); /* string table miss */
									errn = decodeCharacters(stream, dinParameterType->stringValue.charactersLen, dinParameterType->stringValue.characters, dinParameterType_stringValue_CHARACTERS_SIZE);
								} else {
									/* string table hit */
									errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
								}
							}
							dinParameterType->stringValue_isUsed = 1u;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}stringValue) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 4;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 4:
			/* Element[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgBody,ChargingStatusReqType',  base type name='BodyBaseType',  content type='EMPTY',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  derivedBy='EXTENSION'.  */
static int decode_dinChargingStatusReqType(bitstream_t* stream, struct dinChargingStatusReqType* dinChargingStatusReqType) {
	int grammarID = 64;
	int done = 0;
	
	init_dinChargingStatusReqType(dinChargingStatusReqType);
	
	while(!done) {
		switch(grammarID) {
		case 64:
			/* FirstStartTag[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureMethodType',  base type name='anyType',  content type='MIXED',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("http://www.w3.org/2000/09/xmldsig#":HMACOutputLength{0-1},(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})',  derivedBy='RESTRICTION'.  */
static int decode_dinSignatureMethodType(bitstream_t* stream, struct dinSignatureMethodType* dinSignatureMethodType) {
	int grammarID = 130;
	int done = 0;
	
	init_dinSignatureMethodType(dinSignatureMethodType);
	
	while(!done) {
		switch(grammarID) {
		case 130:
			/* FirstStartTag[ATTRIBUTE[STRING](Algorithm)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decodeUnsignedInteger16(stream, &dinSignatureMethodType->Algorithm.charactersLen);
					if (errn == 0) {
						if (dinSignatureMethodType->Algorithm.charactersLen >= 2) {
							dinSignatureMethodType->Algorithm.charactersLen = (uint16_t)(dinSignatureMethodType->Algorithm.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, dinSignatureMethodType->Algorithm.charactersLen, dinSignatureMethodType->Algorithm.characters, dinSignatureMethodType_Algorithm_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					grammarID = 131;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 131:
			/* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */
			errn = decodeNBitUnsignedInteger(stream, 3, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[INTEGER]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeInteger64(stream, &dinSignatureMethodType->HMACOutputLength);
							dinSignatureMethodType->HMACOutputLength_isUsed = 1u;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 20;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 1:
					errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					/* TODO unsupported event : START_ELEMENT_GENERIC */
					grammarID = 20;
					break;
				case 2:
					done = 1;
					grammarID = 5;
					break;
				case 3:
					errn = decodeUnsignedInteger16(stream, &dinSignatureMethodType->ANY.charactersLen);
					if (errn == 0) {
						if (dinSignatureMethodType->ANY.charactersLen >= 2) {
							dinSignatureMethodType->ANY.charactersLen = (uint16_t)(dinSignatureMethodType->ANY.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, dinSignatureMethodType->ANY.charactersLen, dinSignatureMethodType->ANY.characters, dinSignatureMethodType_ANY_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					dinSignatureMethodType->ANY_isUsed = 1u;
					grammarID = 132;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 20:
			/* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					/* TODO unsupported event : START_ELEMENT_GENERIC */
					grammarID = 20;
					break;
				case 1:
					done = 1;
					grammarID = 5;
					break;
				case 2:
					errn = decodeUnsignedInteger16(stream, &dinSignatureMethodType->ANY.charactersLen);
					if (errn == 0) {
						if (dinSignatureMethodType->ANY.charactersLen >= 2) {
							dinSignatureMethodType->ANY.charactersLen = (uint16_t)(dinSignatureMethodType->ANY.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, dinSignatureMethodType->ANY.charactersLen, dinSignatureMethodType->ANY.characters, dinSignatureMethodType_ANY_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					dinSignatureMethodType->ANY_isUsed = 1u;
					grammarID = 20;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 132:
			/* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */
			errn = decodeNBitUnsignedInteger(stream, 3, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[INTEGER]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeInteger64(stream, &dinSignatureMethodType->HMACOutputLength);
							dinSignatureMethodType->HMACOutputLength_isUsed = 1u;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 20;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 1:
					errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					/* TODO unsupported event : START_ELEMENT_GENERIC */
					grammarID = 20;
					break;
				case 2:
					done = 1;
					grammarID = 5;
					break;
				case 3:
					errn = decodeUnsignedInteger16(stream, &dinSignatureMethodType->ANY.charactersLen);
					if (errn == 0) {
						if (dinSignatureMethodType->ANY.charactersLen >= 2) {
							dinSignatureMethodType->ANY.charactersLen = (uint16_t)(dinSignatureMethodType->ANY.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, dinSignatureMethodType->ANY.charactersLen, dinSignatureMethodType->ANY.characters, dinSignatureMethodType_ANY_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					dinSignatureMethodType->ANY_isUsed = 1u;
					grammarID = 132;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgBody,CertificateInstallationReqType',  base type name='BodyBaseType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("urn:iso:15118:2:2010:MsgBody":OEMProvisioningCert,"urn:iso:15118:2:2010:MsgBody":ListOfRootCertificateIDs,"urn:iso:15118:2:2010:MsgBody":DHParams)',  derivedBy='EXTENSION'.  */
static int decode_dinCertificateInstallationReqType(bitstream_t* stream, struct dinCertificateInstallationReqType* dinCertificateInstallationReqType) {
	int grammarID = 133;
	int done = 0;
	
	init_dinCertificateInstallationReqType(dinCertificateInstallationReqType);
	
	while(!done) {
		switch(grammarID) {
		case 133:
			/* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}OEMProvisioningCert)] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decodeUnsignedInteger16(stream, &dinCertificateInstallationReqType->Id.charactersLen);
					if (errn == 0) {
						if (dinCertificateInstallationReqType->Id.charactersLen >= 2) {
							dinCertificateInstallationReqType->Id.charactersLen = (uint16_t)(dinCertificateInstallationReqType->Id.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, dinCertificateInstallationReqType->Id.charactersLen, dinCertificateInstallationReqType->Id.characters, dinCertificateInstallationReqType_Id_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					dinCertificateInstallationReqType->Id_isUsed = 1u;
					grammarID = 134;
					break;
				case 1:
					/* FirstStartTag[CHARACTERS[BINARY_BASE64]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger16(stream, &dinCertificateInstallationReqType->OEMProvisioningCert.bytesLen);
							if (errn == 0) {
								errn =  (dinCertificateInstallationReqType->OEMProvisioningCert.bytesLen) <= dinCertificateInstallationReqType_OEMProvisioningCert_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
							}
							if (errn == 0) {
								errn = decodeBytes(stream, dinCertificateInstallationReqType->OEMProvisioningCert.bytesLen, dinCertificateInstallationReqType->OEMProvisioningCert.bytes);
							}
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}OEMProvisioningCert) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 135;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 134:
			/* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}OEMProvisioningCert)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[BINARY_BASE64]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger16(stream, &dinCertificateInstallationReqType->OEMProvisioningCert.bytesLen);
							if (errn == 0) {
								errn =  (dinCertificateInstallationReqType->OEMProvisioningCert.bytesLen) <= dinCertificateInstallationReqType_OEMProvisioningCert_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
							}
							if (errn == 0) {
								errn = decodeBytes(stream, dinCertificateInstallationReqType->OEMProvisioningCert.bytesLen, dinCertificateInstallationReqType->OEMProvisioningCert.bytes);
							}
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}OEMProvisioningCert) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 135;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 135:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ListOfRootCertificateIDs)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinListOfRootCertificateIDsType(stream, &dinCertificateInstallationReqType->ListOfRootCertificateIDs);
					grammarID = 136;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 136:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DHParams)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[BINARY_BASE64]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger16(stream, &dinCertificateInstallationReqType->DHParams.bytesLen);
							if (errn == 0) {
								errn =  (dinCertificateInstallationReqType->DHParams.bytesLen) <= dinCertificateInstallationReqType_DHParams_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
							}
							if (errn == 0) {
								errn = decodeBytes(stream, dinCertificateInstallationReqType->DHParams.bytesLen, dinCertificateInstallationReqType->DHParams.bytes);
							}
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DHParams) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 4;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 4:
			/* Element[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SalesTariffEntryType',  base type name='EntryType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='(("urn:iso:15118:2:2010:MsgDataTypes":TimeInterval),("urn:iso:15118:2:2010:MsgDataTypes":EPriceLevel,"urn:iso:15118:2:2010:MsgDataTypes":ConsumptionCost{0-UNBOUNDED}))',  derivedBy='EXTENSION'.  */
static int decode_dinSalesTariffEntryType(bitstream_t* stream, struct dinSalesTariffEntryType* dinSalesTariffEntryType) {
	int grammarID = 137;
	int done = 0;
	
	init_dinSalesTariffEntryType(dinSalesTariffEntryType);
	
	while(!done) {
		switch(grammarID) {
		case 137:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RelativeTimeInterval), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TimeInterval)] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinRelativeTimeIntervalType(stream, &dinSalesTariffEntryType->RelativeTimeInterval);
					dinSalesTariffEntryType->RelativeTimeInterval_isUsed = 1u;
					grammarID = 138;
					break;
				case 1:
					errn = decode_dinIntervalType(stream, &dinSalesTariffEntryType->TimeInterval);
					dinSalesTariffEntryType->TimeInterval_isUsed = 1u;
					grammarID = 138;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 138:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EPriceLevel)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeNBitUnsignedInteger(stream, 8, &(uint32));
							dinSalesTariffEntryType->EPriceLevel = (uint8_t)(uint32 + 0);
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EPriceLevel) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 139;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 139:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ConsumptionCost), END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					if (dinSalesTariffEntryType->ConsumptionCost.arrayLen < dinSalesTariffEntryType_ConsumptionCost_ARRAY_SIZE) {
						errn = decode_dinConsumptionCostType(stream, &dinSalesTariffEntryType->ConsumptionCost.array[dinSalesTariffEntryType->ConsumptionCost.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 139;
					break;
				case 1:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgBody,ServiceDiscoveryResType',  base type name='BodyBaseType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":PaymentOptions,"urn:iso:15118:2:2010:MsgBody":ChargeService,"urn:iso:15118:2:2010:MsgBody":ServiceList{0-1})',  derivedBy='EXTENSION'.  */
static int decode_dinServiceDiscoveryResType(bitstream_t* stream, struct dinServiceDiscoveryResType* dinServiceDiscoveryResType) {
	int grammarID = 140;
	int done = 0;
	
	init_dinServiceDiscoveryResType(dinServiceDiscoveryResType);
	
	while(!done) {
		switch(grammarID) {
		case 140:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[ENUMERATION]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeNBitUnsignedInteger(stream, 5, &uint32);
							dinServiceDiscoveryResType->ResponseCode = (dinresponseCodeType) uint32;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 141;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 141:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PaymentOptions)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinPaymentOptionsType(stream, &dinServiceDiscoveryResType->PaymentOptions);
					grammarID = 142;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 142:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargeService)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinServiceChargeType(stream, &dinServiceDiscoveryResType->ChargeService);
					grammarID = 143;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 143:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceList), END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinServiceTagListType(stream, &dinServiceDiscoveryResType->ServiceList);
					dinServiceDiscoveryResType->ServiceList_isUsed = 1u;
					grammarID = 4;
					break;
				case 1:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 4:
			/* Element[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ParameterSetType',  base type name='anyType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("urn:iso:15118:2:2010:MsgDataTypes":ParameterSetID,"urn:iso:15118:2:2010:MsgDataTypes":Parameter{1-UNBOUNDED})',  derivedBy='RESTRICTION'.  */
static int decode_dinParameterSetType(bitstream_t* stream, struct dinParameterSetType* dinParameterSetType) {
	int grammarID = 144;
	int done = 0;
	
	init_dinParameterSetType(dinParameterSetType);
	
	while(!done) {
		switch(grammarID) {
		case 144:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ParameterSetID)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeInteger16(stream, &dinParameterSetType->ParameterSetID);
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ParameterSetID) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 145;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 145:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Parameter)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					if (dinParameterSetType->Parameter.arrayLen < dinParameterSetType_Parameter_ARRAY_SIZE) {
						errn = decode_dinParameterType(stream, &dinParameterSetType->Parameter.array[dinParameterSetType->Parameter.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 146;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 146:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Parameter), END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					if (dinParameterSetType->Parameter.arrayLen < dinParameterSetType_Parameter_ARRAY_SIZE) {
						errn = decode_dinParameterType(stream, &dinParameterSetType->Parameter.array[dinParameterSetType->Parameter.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 146;
					break;
				case 1:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgBody,CurrentDemandReqType',  base type name='BodyBaseType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("urn:iso:15118:2:2010:MsgBody":DC_EVStatus,"urn:iso:15118:2:2010:MsgBody":EVTargetCurrent,"urn:iso:15118:2:2010:MsgBody":EVMaximumVoltageLimit{0-1},"urn:iso:15118:2:2010:MsgBody":EVMaximumCurrentLimit{0-1},"urn:iso:15118:2:2010:MsgBody":EVMaximumPowerLimit{0-1},"urn:iso:15118:2:2010:MsgBody":BulkChargingComplete{0-1},"urn:iso:15118:2:2010:MsgBody":ChargingComplete,"urn:iso:15118:2:2010:MsgBody":RemainingTimeToFullSoC{0-1},"urn:iso:15118:2:2010:MsgBody":RemainingTimeToBulkSoC{0-1},"urn:iso:15118:2:2010:MsgBody":EVTargetVoltage)',  derivedBy='EXTENSION'.  */
static int decode_dinCurrentDemandReqType(bitstream_t* stream, struct dinCurrentDemandReqType* dinCurrentDemandReqType) {
	int grammarID = 147;
	int done = 0;
	
	init_dinCurrentDemandReqType(dinCurrentDemandReqType);
	
	while(!done) {
		switch(grammarID) {
		case 147:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVStatus)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinDC_EVStatusType(stream, &dinCurrentDemandReqType->DC_EVStatus);
					grammarID = 148;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 148:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetCurrent)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVTargetCurrent);
					grammarID = 149;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 149:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumVoltageLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete)] */
			errn = decodeNBitUnsignedInteger(stream, 3, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVMaximumVoltageLimit);
					dinCurrentDemandReqType->EVMaximumVoltageLimit_isUsed = 1u;
					grammarID = 150;
					break;
				case 1:
					errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVMaximumCurrentLimit);
					dinCurrentDemandReqType->EVMaximumCurrentLimit_isUsed = 1u;
					grammarID = 151;
					break;
				case 2:
					errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVMaximumPowerLimit);
					dinCurrentDemandReqType->EVMaximumPowerLimit_isUsed = 1u;
					grammarID = 152;
					break;
				case 3:
					/* FirstStartTag[CHARACTERS[BOOLEAN]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeBoolean(stream, &dinCurrentDemandReqType->BulkChargingComplete);
							dinCurrentDemandReqType->BulkChargingComplete_isUsed = 1u;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}BulkChargingComplete) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 153;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 4:
					/* FirstStartTag[CHARACTERS[BOOLEAN]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeBoolean(stream, &dinCurrentDemandReqType->ChargingComplete);
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 154;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 150:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete)] */
			errn = decodeNBitUnsignedInteger(stream, 3, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVMaximumCurrentLimit);
					dinCurrentDemandReqType->EVMaximumCurrentLimit_isUsed = 1u;
					grammarID = 151;
					break;
				case 1:
					errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVMaximumPowerLimit);
					dinCurrentDemandReqType->EVMaximumPowerLimit_isUsed = 1u;
					grammarID = 152;
					break;
				case 2:
					/* FirstStartTag[CHARACTERS[BOOLEAN]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeBoolean(stream, &dinCurrentDemandReqType->BulkChargingComplete);
							dinCurrentDemandReqType->BulkChargingComplete_isUsed = 1u;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}BulkChargingComplete) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 153;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 3:
					/* FirstStartTag[CHARACTERS[BOOLEAN]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeBoolean(stream, &dinCurrentDemandReqType->ChargingComplete);
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 154;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 151:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete)] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVMaximumPowerLimit);
					dinCurrentDemandReqType->EVMaximumPowerLimit_isUsed = 1u;
					grammarID = 152;
					break;
				case 1:
					/* FirstStartTag[CHARACTERS[BOOLEAN]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeBoolean(stream, &dinCurrentDemandReqType->BulkChargingComplete);
							dinCurrentDemandReqType->BulkChargingComplete_isUsed = 1u;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}BulkChargingComplete) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 153;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 2:
					/* FirstStartTag[CHARACTERS[BOOLEAN]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeBoolean(stream, &dinCurrentDemandReqType->ChargingComplete);
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 154;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 152:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete)] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[BOOLEAN]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeBoolean(stream, &dinCurrentDemandReqType->BulkChargingComplete);
							dinCurrentDemandReqType->BulkChargingComplete_isUsed = 1u;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}BulkChargingComplete) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 153;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 1:
					/* FirstStartTag[CHARACTERS[BOOLEAN]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeBoolean(stream, &dinCurrentDemandReqType->ChargingComplete);
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 154;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 153:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[BOOLEAN]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeBoolean(stream, &dinCurrentDemandReqType->ChargingComplete);
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 154;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 154:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}RemainingTimeToFullSoC), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}RemainingTimeToBulkSoC), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetVoltage)] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->RemainingTimeToFullSoC);
					dinCurrentDemandReqType->RemainingTimeToFullSoC_isUsed = 1u;
					grammarID = 155;
					break;
				case 1:
					errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->RemainingTimeToBulkSoC);
					dinCurrentDemandReqType->RemainingTimeToBulkSoC_isUsed = 1u;
					grammarID = 156;
					break;
				case 2:
					errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVTargetVoltage);
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 155:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}RemainingTimeToBulkSoC), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetVoltage)] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->RemainingTimeToBulkSoC);
					dinCurrentDemandReqType->RemainingTimeToBulkSoC_isUsed = 1u;
					grammarID = 156;
					break;
				case 1:
					errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVTargetVoltage);
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 156:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetVoltage)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinPhysicalValueType(stream, &dinCurrentDemandReqType->EVTargetVoltage);
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 4:
			/* Element[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgBody,PreChargeReqType',  base type name='BodyBaseType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("urn:iso:15118:2:2010:MsgBody":DC_EVStatus,"urn:iso:15118:2:2010:MsgBody":EVTargetVoltage,"urn:iso:15118:2:2010:MsgBody":EVTargetCurrent)',  derivedBy='EXTENSION'.  */
static int decode_dinPreChargeReqType(bitstream_t* stream, struct dinPreChargeReqType* dinPreChargeReqType) {
	int grammarID = 157;
	int done = 0;
	
	init_dinPreChargeReqType(dinPreChargeReqType);
	
	while(!done) {
		switch(grammarID) {
		case 157:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVStatus)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinDC_EVStatusType(stream, &dinPreChargeReqType->DC_EVStatus);
					grammarID = 158;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 158:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetVoltage)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinPhysicalValueType(stream, &dinPreChargeReqType->EVTargetVoltage);
					grammarID = 159;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 159:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetCurrent)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinPhysicalValueType(stream, &dinPreChargeReqType->EVTargetCurrent);
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 4:
			/* Element[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureType',  base type name='anyType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("http://www.w3.org/2000/09/xmldsig#":SignedInfo,"http://www.w3.org/2000/09/xmldsig#":SignatureValue,"http://www.w3.org/2000/09/xmldsig#":KeyInfo{0-1},"http://www.w3.org/2000/09/xmldsig#":Object{0-UNBOUNDED})',  derivedBy='RESTRICTION'.  */
static int decode_dinSignatureType(bitstream_t* stream, struct dinSignatureType* dinSignatureType) {
	int grammarID = 160;
	int done = 0;
	
	init_dinSignatureType(dinSignatureType);
	
	while(!done) {
		switch(grammarID) {
		case 160:
			/* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignedInfo)] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decodeUnsignedInteger16(stream, &dinSignatureType->Id.charactersLen);
					if (errn == 0) {
						if (dinSignatureType->Id.charactersLen >= 2) {
							dinSignatureType->Id.charactersLen = (uint16_t)(dinSignatureType->Id.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, dinSignatureType->Id.charactersLen, dinSignatureType->Id.characters, dinSignatureType_Id_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					dinSignatureType->Id_isUsed = 1u;
					grammarID = 161;
					break;
				case 1:
					errn = decode_dinSignedInfoType(stream, &dinSignatureType->SignedInfo);
					grammarID = 162;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 161:
			/* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignedInfo)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinSignedInfoType(stream, &dinSignatureType->SignedInfo);
					grammarID = 162;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 162:
			/* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureValue)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinSignatureValueType(stream, &dinSignatureType->SignatureValue);
					grammarID = 163;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 163:
			/* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyInfo), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Object), END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinKeyInfoType(stream, &dinSignatureType->KeyInfo);
					dinSignatureType->KeyInfo_isUsed = 1u;
					grammarID = 164;
					break;
				case 1:
					if (dinSignatureType->Object.arrayLen < dinSignatureType_Object_ARRAY_SIZE) {
						errn = decode_dinObjectType(stream, &dinSignatureType->Object.array[dinSignatureType->Object.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 164;
					break;
				case 2:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 164:
			/* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Object), END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					if (dinSignatureType->Object.arrayLen < dinSignatureType_Object_ARRAY_SIZE) {
						errn = decode_dinObjectType(stream, &dinSignatureType->Object.array[dinSignatureType->Object.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 164;
					break;
				case 1:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ReferenceType',  base type name='anyType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1},"http://www.w3.org/2000/09/xmldsig#":DigestMethod,"http://www.w3.org/2000/09/xmldsig#":DigestValue)',  derivedBy='RESTRICTION'.  */
static int decode_dinReferenceType(bitstream_t* stream, struct dinReferenceType* dinReferenceType) {
	int grammarID = 165;
	int done = 0;
	
	init_dinReferenceType(dinReferenceType);
	
	while(!done) {
		switch(grammarID) {
		case 165:
			/* FirstStartTag[ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](Type), ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */
			errn = decodeNBitUnsignedInteger(stream, 3, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decodeUnsignedInteger16(stream, &dinReferenceType->Id.charactersLen);
					if (errn == 0) {
						if (dinReferenceType->Id.charactersLen >= 2) {
							dinReferenceType->Id.charactersLen = (uint16_t)(dinReferenceType->Id.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, dinReferenceType->Id.charactersLen, dinReferenceType->Id.characters, dinReferenceType_Id_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					dinReferenceType->Id_isUsed = 1u;
					grammarID = 166;
					break;
				case 1:
					errn = decodeUnsignedInteger16(stream, &dinReferenceType->Type.charactersLen);
					if (errn == 0) {
						if (dinReferenceType->Type.charactersLen >= 2) {
							dinReferenceType->Type.charactersLen = (uint16_t)(dinReferenceType->Type.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, dinReferenceType->Type.charactersLen, dinReferenceType->Type.characters, dinReferenceType_Type_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					dinReferenceType->Type_isUsed = 1u;
					grammarID = 167;
					break;
				case 2:
					errn = decodeUnsignedInteger16(stream, &dinReferenceType->URI.charactersLen);
					if (errn == 0) {
						if (dinReferenceType->URI.charactersLen >= 2) {
							dinReferenceType->URI.charactersLen = (uint16_t)(dinReferenceType->URI.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, dinReferenceType->URI.charactersLen, dinReferenceType->URI.characters, dinReferenceType_URI_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					dinReferenceType->URI_isUsed = 1u;
					grammarID = 168;
					break;
				case 3:
					errn = decode_dinTransformsType(stream, &dinReferenceType->Transforms);
					dinReferenceType->Transforms_isUsed = 1u;
					grammarID = 169;
					break;
				case 4:
					errn = decode_dinDigestMethodType(stream, &dinReferenceType->DigestMethod);
					grammarID = 170;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 166:
			/* StartTag[ATTRIBUTE[STRING](Type), ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */
			errn = decodeNBitUnsignedInteger(stream, 3, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decodeUnsignedInteger16(stream, &dinReferenceType->Type.charactersLen);
					if (errn == 0) {
						if (dinReferenceType->Type.charactersLen >= 2) {
							dinReferenceType->Type.charactersLen = (uint16_t)(dinReferenceType->Type.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, dinReferenceType->Type.charactersLen, dinReferenceType->Type.characters, dinReferenceType_Type_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					dinReferenceType->Type_isUsed = 1u;
					grammarID = 167;
					break;
				case 1:
					errn = decodeUnsignedInteger16(stream, &dinReferenceType->URI.charactersLen);
					if (errn == 0) {
						if (dinReferenceType->URI.charactersLen >= 2) {
							dinReferenceType->URI.charactersLen = (uint16_t)(dinReferenceType->URI.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, dinReferenceType->URI.charactersLen, dinReferenceType->URI.characters, dinReferenceType_URI_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					dinReferenceType->URI_isUsed = 1u;
					grammarID = 168;
					break;
				case 2:
					errn = decode_dinTransformsType(stream, &dinReferenceType->Transforms);
					dinReferenceType->Transforms_isUsed = 1u;
					grammarID = 169;
					break;
				case 3:
					errn = decode_dinDigestMethodType(stream, &dinReferenceType->DigestMethod);
					grammarID = 170;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 167:
			/* StartTag[ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decodeUnsignedInteger16(stream, &dinReferenceType->URI.charactersLen);
					if (errn == 0) {
						if (dinReferenceType->URI.charactersLen >= 2) {
							dinReferenceType->URI.charactersLen = (uint16_t)(dinReferenceType->URI.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, dinReferenceType->URI.charactersLen, dinReferenceType->URI.characters, dinReferenceType_URI_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					dinReferenceType->URI_isUsed = 1u;
					grammarID = 168;
					break;
				case 1:
					errn = decode_dinTransformsType(stream, &dinReferenceType->Transforms);
					dinReferenceType->Transforms_isUsed = 1u;
					grammarID = 169;
					break;
				case 2:
					errn = decode_dinDigestMethodType(stream, &dinReferenceType->DigestMethod);
					grammarID = 170;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 168:
			/* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinTransformsType(stream, &dinReferenceType->Transforms);
					dinReferenceType->Transforms_isUsed = 1u;
					grammarID = 169;
					break;
				case 1:
					errn = decode_dinDigestMethodType(stream, &dinReferenceType->DigestMethod);
					grammarID = 170;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 169:
			/* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinDigestMethodType(stream, &dinReferenceType->DigestMethod);
					grammarID = 170;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 170:
			/* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestValue)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[BINARY_BASE64]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger16(stream, &dinReferenceType->DigestValue.bytesLen);
							if (errn == 0) {
								errn =  (dinReferenceType->DigestValue.bytesLen) <= dinReferenceType_DigestValue_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
							}
							if (errn == 0) {
								errn = decodeBytes(stream, dinReferenceType->DigestValue.bytesLen, dinReferenceType->DigestValue.bytes);
							}
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestValue) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 4;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 4:
			/* Element[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ProfileEntryType',  base type name='anyType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("urn:iso:15118:2:2010:MsgDataTypes":ChargingProfileEntryStart,"urn:iso:15118:2:2010:MsgDataTypes":ChargingProfileEntryMaxPower)',  derivedBy='RESTRICTION'.  */
static int decode_dinProfileEntryType(bitstream_t* stream, struct dinProfileEntryType* dinProfileEntryType) {
	int grammarID = 171;
	int done = 0;
	
	init_dinProfileEntryType(dinProfileEntryType);
	
	while(!done) {
		switch(grammarID) {
		case 171:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingProfileEntryStart)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger32(stream, &dinProfileEntryType->ChargingProfileEntryStart);
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingProfileEntryStart) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 172;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 172:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingProfileEntryMaxPower)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[INTEGER]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeInteger16(stream, &dinProfileEntryType->ChargingProfileEntryMaxPower);
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingProfileEntryMaxPower) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 4;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 4:
			/* Element[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgDef,#AnonType_V2G_Message',  base type name='anyType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("urn:iso:15118:2:2010:MsgDef":Header,"urn:iso:15118:2:2010:MsgDef":Body)',  derivedBy='RESTRICTION'.  */
static int decode_dinAnonType_V2G_Message(bitstream_t* stream, struct dinAnonType_V2G_Message* dinAnonType_V2G_Message) {
	int grammarID = 173;
	int done = 0;
	
	init_dinAnonType_V2G_Message(dinAnonType_V2G_Message);
	
	while(!done) {
		switch(grammarID) {
		case 173:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDef}Header)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinMessageHeaderType(stream, &dinAnonType_V2G_Message->Header);
					grammarID = 174;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 174:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDef}Body)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinBodyType(stream, &dinAnonType_V2G_Message->Body);
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 4:
			/* Element[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgBody,ChargeParameterDiscoveryReqType',  base type name='BodyBaseType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("urn:iso:15118:2:2010:MsgBody":EVRequestedEnergyTransferType,"urn:iso:15118:2:2010:MsgDataTypes":EVChargeParameter)',  derivedBy='EXTENSION'.  */
static int decode_dinChargeParameterDiscoveryReqType(bitstream_t* stream, struct dinChargeParameterDiscoveryReqType* dinChargeParameterDiscoveryReqType) {
	int grammarID = 175;
	int done = 0;
	
	init_dinChargeParameterDiscoveryReqType(dinChargeParameterDiscoveryReqType);
	
	while(!done) {
		switch(grammarID) {
		case 175:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVRequestedEnergyTransferType)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[ENUMERATION]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeNBitUnsignedInteger(stream, 3, &uint32);
							dinChargeParameterDiscoveryReqType->EVRequestedEnergyTransferType = (dinEVRequestedEnergyTransferType) uint32;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVRequestedEnergyTransferType) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 176;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 176:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVChargeParameter)] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinAC_EVChargeParameterType(stream, &dinChargeParameterDiscoveryReqType->AC_EVChargeParameter);
					dinChargeParameterDiscoveryReqType->AC_EVChargeParameter_isUsed = 1u;
					grammarID = 4;
					break;
				case 1:
					errn = decode_dinDC_EVChargeParameterType(stream, &dinChargeParameterDiscoveryReqType->DC_EVChargeParameter);
					dinChargeParameterDiscoveryReqType->DC_EVChargeParameter_isUsed = 1u;
					grammarID = 4;
					break;
				case 2:
					errn = decode_dinEVChargeParameterType(stream, &dinChargeParameterDiscoveryReqType->EVChargeParameter);
					dinChargeParameterDiscoveryReqType->EVChargeParameter_isUsed = 1u;
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 4:
			/* Element[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ConsumptionCostType',  base type name='anyType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("urn:iso:15118:2:2010:MsgDataTypes":startValue,"urn:iso:15118:2:2010:MsgDataTypes":Cost{0-UNBOUNDED})',  derivedBy='RESTRICTION'.  */
static int decode_dinConsumptionCostType(bitstream_t* stream, struct dinConsumptionCostType* dinConsumptionCostType) {
	int grammarID = 177;
	int done = 0;
	
	init_dinConsumptionCostType(dinConsumptionCostType);
	
	while(!done) {
		switch(grammarID) {
		case 177:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}startValue)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger32(stream, &dinConsumptionCostType->startValue);
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}startValue) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 178;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 178:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Cost), END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					if (dinConsumptionCostType->Cost.arrayLen < dinConsumptionCostType_Cost_ARRAY_SIZE) {
						errn = decode_dinCostType(stream, &dinConsumptionCostType->Cost.array[dinConsumptionCostType->Cost.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 178;
					break;
				case 1:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='http://www.w3.org/2000/09/xmldsig#,RSAKeyValueType',  base type name='anyType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("http://www.w3.org/2000/09/xmldsig#":Modulus,"http://www.w3.org/2000/09/xmldsig#":Exponent)',  derivedBy='RESTRICTION'.  */
static int decode_dinRSAKeyValueType(bitstream_t* stream, struct dinRSAKeyValueType* dinRSAKeyValueType) {
	int grammarID = 179;
	int done = 0;
	
	init_dinRSAKeyValueType(dinRSAKeyValueType);
	
	while(!done) {
		switch(grammarID) {
		case 179:
			/* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Modulus)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[BINARY_BASE64]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger16(stream, &dinRSAKeyValueType->Modulus.bytesLen);
							if (errn == 0) {
								errn =  (dinRSAKeyValueType->Modulus.bytesLen) <= dinRSAKeyValueType_Modulus_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
							}
							if (errn == 0) {
								errn = decodeBytes(stream, dinRSAKeyValueType->Modulus.bytesLen, dinRSAKeyValueType->Modulus.bytes);
							}
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Modulus) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 180;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 180:
			/* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Exponent)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[BINARY_BASE64]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger16(stream, &dinRSAKeyValueType->Exponent.bytesLen);
							if (errn == 0) {
								errn =  (dinRSAKeyValueType->Exponent.bytesLen) <= dinRSAKeyValueType_Exponent_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
							}
							if (errn == 0) {
								errn = decodeBytes(stream, dinRSAKeyValueType->Exponent.bytesLen, dinRSAKeyValueType->Exponent.bytes);
							}
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Exponent) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 4;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 4:
			/* Element[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceType',  base type name='anyType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("urn:iso:15118:2:2010:MsgDataTypes":ServiceTag,"urn:iso:15118:2:2010:MsgDataTypes":FreeService)',  derivedBy='RESTRICTION'.  */
static int decode_dinServiceType(bitstream_t* stream, struct dinServiceType* dinServiceType) {
	int grammarID = 181;
	int done = 0;
	
	init_dinServiceType(dinServiceType);
	
	while(!done) {
		switch(grammarID) {
		case 181:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceTag)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinServiceTagType(stream, &dinServiceType->ServiceTag);
					grammarID = 182;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 182:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FreeService)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[BOOLEAN]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeBoolean(stream, &dinServiceType->FreeService);
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FreeService) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 4;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 4:
			/* Element[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceTagListType',  base type name='anyType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("urn:iso:15118:2:2010:MsgDataTypes":Service{1-UNBOUNDED})',  derivedBy='RESTRICTION'.  */
static int decode_dinServiceTagListType(bitstream_t* stream, struct dinServiceTagListType* dinServiceTagListType) {
	int grammarID = 183;
	int done = 0;
	
	init_dinServiceTagListType(dinServiceTagListType);
	
	while(!done) {
		switch(grammarID) {
		case 183:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Service)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					if (dinServiceTagListType->Service.arrayLen < dinServiceTagListType_Service_ARRAY_SIZE) {
						errn = decode_dinServiceType(stream, &dinServiceTagListType->Service.array[dinServiceTagListType->Service.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 184;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 184:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Service), END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					if (dinServiceTagListType->Service.arrayLen < dinServiceTagListType_Service_ARRAY_SIZE) {
						errn = decode_dinServiceType(stream, &dinServiceTagListType->Service.array[dinServiceTagListType->Service.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 184;
					break;
				case 1:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EVSEStatusType',  base type name='anyType',  content type='EMPTY',  isAbstract='true',  hasTypeId='false',  final='0',  block='0',  derivedBy='RESTRICTION'.  */
static int decode_dinEVSEStatusType(bitstream_t* stream, struct dinEVSEStatusType* dinEVSEStatusType) {
	int grammarID = 64;
	int done = 0;
	
	init_dinEVSEStatusType(dinEVSEStatusType);
	
	while(!done) {
		switch(grammarID) {
		case 64:
			/* FirstStartTag[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgBody,SessionSetupResType',  base type name='BodyBaseType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":EVSEID,"urn:iso:15118:2:2010:MsgBody":DateTimeNow{0-1})',  derivedBy='EXTENSION'.  */
static int decode_dinSessionSetupResType(bitstream_t* stream, struct dinSessionSetupResType* dinSessionSetupResType) {
	int grammarID = 185;
	int done = 0;
	
	init_dinSessionSetupResType(dinSessionSetupResType);
	
	while(!done) {
		switch(grammarID) {
		case 185:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[ENUMERATION]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeNBitUnsignedInteger(stream, 5, &uint32);
							dinSessionSetupResType->ResponseCode = (dinresponseCodeType) uint32;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 186;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 186:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEID)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[BINARY_HEX]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger16(stream, &dinSessionSetupResType->EVSEID.bytesLen);
							if (errn == 0) {
								errn =  (dinSessionSetupResType->EVSEID.bytesLen) <= dinSessionSetupResType_EVSEID_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
							}
							if (errn == 0) {
								errn = decodeBytes(stream, dinSessionSetupResType->EVSEID.bytesLen, dinSessionSetupResType->EVSEID.bytes);
							}
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEID) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 187;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 187:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DateTimeNow), END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeInteger64(stream, &dinSessionSetupResType->DateTimeNow);
							dinSessionSetupResType->DateTimeNow_isUsed = 1u;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DateTimeNow) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 4;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 1:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 4:
			/* Element[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,EVPowerDeliveryParameterType',  base type name='anyType',  content type='EMPTY',  isAbstract='true',  hasTypeId='false',  final='0',  block='0',  derivedBy='RESTRICTION'.  */
static int decode_dinEVPowerDeliveryParameterType(bitstream_t* stream, struct dinEVPowerDeliveryParameterType* dinEVPowerDeliveryParameterType) {
	int grammarID = 64;
	int done = 0;
	
	init_dinEVPowerDeliveryParameterType(dinEVPowerDeliveryParameterType);
	
	while(!done) {
		switch(grammarID) {
		case 64:
			/* FirstStartTag[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='http://www.w3.org/2000/09/xmldsig#,X509IssuerSerialType',  base type name='anyType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("http://www.w3.org/2000/09/xmldsig#":X509IssuerName,"http://www.w3.org/2000/09/xmldsig#":X509SerialNumber)',  derivedBy='RESTRICTION'.  */
static int decode_dinX509IssuerSerialType(bitstream_t* stream, struct dinX509IssuerSerialType* dinX509IssuerSerialType) {
	int grammarID = 188;
	int done = 0;
	
	init_dinX509IssuerSerialType(dinX509IssuerSerialType);
	
	while(!done) {
		switch(grammarID) {
		case 188:
			/* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerName)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* First(xsi:type)StartTag[CHARACTERS[STRING]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger16(stream, &dinX509IssuerSerialType->X509IssuerName.charactersLen);
							if (errn == 0) {
								if (dinX509IssuerSerialType->X509IssuerName.charactersLen >= 2) {
									dinX509IssuerSerialType->X509IssuerName.charactersLen = (uint16_t)(dinX509IssuerSerialType->X509IssuerName.charactersLen - 2); /* string table miss */
									errn = decodeCharacters(stream, dinX509IssuerSerialType->X509IssuerName.charactersLen, dinX509IssuerSerialType->X509IssuerName.characters, dinX509IssuerSerialType_X509IssuerName_CHARACTERS_SIZE);
								} else {
									/* string table hit */
									errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
								}
							}
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerName) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 189;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 189:
			/* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SerialNumber)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeInteger64(stream, &dinX509IssuerSerialType->X509SerialNumber);
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SerialNumber) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 4;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 4:
			/* Element[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SelectedServiceType',  base type name='anyType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("urn:iso:15118:2:2010:MsgDataTypes":ServiceID,"urn:iso:15118:2:2010:MsgDataTypes":ParameterSetID{0-1})',  derivedBy='RESTRICTION'.  */
static int decode_dinSelectedServiceType(bitstream_t* stream, struct dinSelectedServiceType* dinSelectedServiceType) {
	int grammarID = 190;
	int done = 0;
	
	init_dinSelectedServiceType(dinSelectedServiceType);
	
	while(!done) {
		switch(grammarID) {
		case 190:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceID)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger16(stream, &dinSelectedServiceType->ServiceID);
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceID) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 191;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 191:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ParameterSetID), END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeInteger16(stream, &dinSelectedServiceType->ParameterSetID);
							dinSelectedServiceType->ParameterSetID_isUsed = 1u;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ParameterSetID) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 4;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 1:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 4:
			/* Element[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgBody,MeteringReceiptResType',  base type name='BodyBaseType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":AC_EVSEStatus)',  derivedBy='EXTENSION'.  */
static int decode_dinMeteringReceiptResType(bitstream_t* stream, struct dinMeteringReceiptResType* dinMeteringReceiptResType) {
	int grammarID = 192;
	int done = 0;
	
	init_dinMeteringReceiptResType(dinMeteringReceiptResType);
	
	while(!done) {
		switch(grammarID) {
		case 192:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[ENUMERATION]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeNBitUnsignedInteger(stream, 5, &uint32);
							dinMeteringReceiptResType->ResponseCode = (dinresponseCodeType) uint32;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 54;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 54:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}AC_EVSEStatus)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinAC_EVSEStatusType(stream, &dinMeteringReceiptResType->AC_EVSEStatus);
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 4:
			/* Element[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVStatusType',  base type name='EVStatusType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("urn:iso:15118:2:2010:MsgDataTypes":EVReady,"urn:iso:15118:2:2010:MsgDataTypes":EVCabinConditioning{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVRESSConditioning{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVErrorCode,"urn:iso:15118:2:2010:MsgDataTypes":EVRESSSOC)',  derivedBy='EXTENSION'.  */
static int decode_dinDC_EVStatusType(bitstream_t* stream, struct dinDC_EVStatusType* dinDC_EVStatusType) {
	int grammarID = 193;
	int done = 0;
	
	init_dinDC_EVStatusType(dinDC_EVStatusType);
	
	while(!done) {
		switch(grammarID) {
		case 193:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVReady)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[BOOLEAN]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeBoolean(stream, &dinDC_EVStatusType->EVReady);
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVReady) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 194;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 194:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVCabinConditioning), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVRESSConditioning), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVErrorCode)] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[BOOLEAN]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeBoolean(stream, &dinDC_EVStatusType->EVCabinConditioning);
							dinDC_EVStatusType->EVCabinConditioning_isUsed = 1u;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVCabinConditioning) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 195;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 1:
					/* FirstStartTag[CHARACTERS[BOOLEAN]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeBoolean(stream, &dinDC_EVStatusType->EVRESSConditioning);
							dinDC_EVStatusType->EVRESSConditioning_isUsed = 1u;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVRESSConditioning) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 196;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 2:
					/* FirstStartTag[CHARACTERS[ENUMERATION]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeNBitUnsignedInteger(stream, 4, &uint32);
							dinDC_EVStatusType->EVErrorCode = (dinDC_EVErrorCodeType) uint32;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVErrorCode) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 197;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 195:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVRESSConditioning), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVErrorCode)] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[BOOLEAN]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeBoolean(stream, &dinDC_EVStatusType->EVRESSConditioning);
							dinDC_EVStatusType->EVRESSConditioning_isUsed = 1u;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVRESSConditioning) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 196;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 1:
					/* FirstStartTag[CHARACTERS[ENUMERATION]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeNBitUnsignedInteger(stream, 4, &uint32);
							dinDC_EVStatusType->EVErrorCode = (dinDC_EVErrorCodeType) uint32;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVErrorCode) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 197;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 196:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVErrorCode)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[ENUMERATION]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeNBitUnsignedInteger(stream, 4, &uint32);
							dinDC_EVStatusType->EVErrorCode = (dinDC_EVErrorCodeType) uint32;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVErrorCode) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 197;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 197:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVRESSSOC)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeNBitUnsignedInteger(stream, 7, &(uint32));
							dinDC_EVStatusType->EVRESSSOC = (int8_t)(uint32 + 0);
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVRESSSOC) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 4;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 4:
			/* Element[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PhysicalValueType',  base type name='anyType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("urn:iso:15118:2:2010:MsgDataTypes":Multiplier,"urn:iso:15118:2:2010:MsgDataTypes":Unit{0-1},"urn:iso:15118:2:2010:MsgDataTypes":Value)',  derivedBy='RESTRICTION'.  */
static int decode_dinPhysicalValueType(bitstream_t* stream, struct dinPhysicalValueType* dinPhysicalValueType) {
	int grammarID = 198;
	int done = 0;
	
	init_dinPhysicalValueType(dinPhysicalValueType);
	
	while(!done) {
		switch(grammarID) {
		case 198:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Multiplier)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeNBitUnsignedInteger(stream, 3, &(uint32));
							dinPhysicalValueType->Multiplier = (int8_t)(uint32 -3);
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Multiplier) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 199;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 199:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Unit), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Value)] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[ENUMERATION]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeNBitUnsignedInteger(stream, 4, &uint32);
							dinPhysicalValueType->Unit = (dinunitSymbolType) uint32;
							dinPhysicalValueType->Unit_isUsed = 1u;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Unit) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 200;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 1:
					/* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeInteger16(stream, &dinPhysicalValueType->Value);
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Value) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 4;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 200:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Value)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeInteger16(stream, &dinPhysicalValueType->Value);
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Value) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 4;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 4:
			/* Element[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ManifestType',  base type name='anyType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("http://www.w3.org/2000/09/xmldsig#":Reference{1-UNBOUNDED})',  derivedBy='RESTRICTION'.  */
static int decode_dinManifestType(bitstream_t* stream, struct dinManifestType* dinManifestType) {
	int grammarID = 201;
	int done = 0;
	
	init_dinManifestType(dinManifestType);
	
	while(!done) {
		switch(grammarID) {
		case 201:
			/* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference)] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decodeUnsignedInteger16(stream, &dinManifestType->Id.charactersLen);
					if (errn == 0) {
						if (dinManifestType->Id.charactersLen >= 2) {
							dinManifestType->Id.charactersLen = (uint16_t)(dinManifestType->Id.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, dinManifestType->Id.charactersLen, dinManifestType->Id.characters, dinManifestType_Id_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					dinManifestType->Id_isUsed = 1u;
					grammarID = 202;
					break;
				case 1:
					if (dinManifestType->Reference.arrayLen < dinManifestType_Reference_ARRAY_SIZE) {
						errn = decode_dinReferenceType(stream, &dinManifestType->Reference.array[dinManifestType->Reference.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 203;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 202:
			/* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					if (dinManifestType->Reference.arrayLen < dinManifestType_Reference_ARRAY_SIZE) {
						errn = decode_dinReferenceType(stream, &dinManifestType->Reference.array[dinManifestType->Reference.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 203;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 203:
			/* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference), END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					if (dinManifestType->Reference.arrayLen < dinManifestType_Reference_ARRAY_SIZE) {
						errn = decode_dinReferenceType(stream, &dinManifestType->Reference.array[dinManifestType->Reference.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 203;
					break;
				case 1:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PMaxScheduleEntryType',  base type name='EntryType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='(("urn:iso:15118:2:2010:MsgDataTypes":TimeInterval),("urn:iso:15118:2:2010:MsgDataTypes":PMax))',  derivedBy='EXTENSION'.  */
static int decode_dinPMaxScheduleEntryType(bitstream_t* stream, struct dinPMaxScheduleEntryType* dinPMaxScheduleEntryType) {
	int grammarID = 204;
	int done = 0;
	
	init_dinPMaxScheduleEntryType(dinPMaxScheduleEntryType);
	
	while(!done) {
		switch(grammarID) {
		case 204:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RelativeTimeInterval), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TimeInterval)] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinRelativeTimeIntervalType(stream, &dinPMaxScheduleEntryType->RelativeTimeInterval);
					dinPMaxScheduleEntryType->RelativeTimeInterval_isUsed = 1u;
					grammarID = 205;
					break;
				case 1:
					errn = decode_dinIntervalType(stream, &dinPMaxScheduleEntryType->TimeInterval);
					dinPMaxScheduleEntryType->TimeInterval_isUsed = 1u;
					grammarID = 205;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 205:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMax)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[INTEGER]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeInteger16(stream, &dinPMaxScheduleEntryType->PMax);
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMax) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 4;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 4:
			/* Element[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceParameterListType',  base type name='anyType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("urn:iso:15118:2:2010:MsgDataTypes":ParameterSet{1-UNBOUNDED})',  derivedBy='RESTRICTION'.  */
static int decode_dinServiceParameterListType(bitstream_t* stream, struct dinServiceParameterListType* dinServiceParameterListType) {
	int grammarID = 206;
	int done = 0;
	
	init_dinServiceParameterListType(dinServiceParameterListType);
	
	while(!done) {
		switch(grammarID) {
		case 206:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ParameterSet)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					if (dinServiceParameterListType->ParameterSet.arrayLen < dinServiceParameterListType_ParameterSet_ARRAY_SIZE) {
						errn = decode_dinParameterSetType(stream, &dinServiceParameterListType->ParameterSet.array[dinServiceParameterListType->ParameterSet.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 207;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 207:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ParameterSet), END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					if (dinServiceParameterListType->ParameterSet.arrayLen < dinServiceParameterListType_ParameterSet_ARRAY_SIZE) {
						errn = decode_dinParameterSetType(stream, &dinServiceParameterListType->ParameterSet.array[dinServiceParameterListType->ParameterSet.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 207;
					break;
				case 1:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignatureValueType',  base type name='base64Binary',  content type='SIMPLE',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  derivedBy='EXTENSION'.  */
static int decode_dinSignatureValueType(bitstream_t* stream, struct dinSignatureValueType* dinSignatureValueType) {
	int grammarID = 208;
	int done = 0;
	
	init_dinSignatureValueType(dinSignatureValueType);
	
	while(!done) {
		switch(grammarID) {
		case 208:
			/* FirstStartTag[ATTRIBUTE[STRING](Id), CHARACTERS[BINARY_BASE64]] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decodeUnsignedInteger16(stream, &dinSignatureValueType->Id.charactersLen);
					if (errn == 0) {
						if (dinSignatureValueType->Id.charactersLen >= 2) {
							dinSignatureValueType->Id.charactersLen = (uint16_t)(dinSignatureValueType->Id.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, dinSignatureValueType->Id.charactersLen, dinSignatureValueType->Id.characters, dinSignatureValueType_Id_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					dinSignatureValueType->Id_isUsed = 1u;
					grammarID = 209;
					break;
				case 1:
					errn = decodeUnsignedInteger16(stream, &dinSignatureValueType->CONTENT.bytesLen);
					if (errn == 0) {
						errn =  (dinSignatureValueType->CONTENT.bytesLen) <= dinSignatureValueType_CONTENT_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
					}
					if (errn == 0) {
						errn = decodeBytes(stream, dinSignatureValueType->CONTENT.bytesLen, dinSignatureValueType->CONTENT.bytes);
					}
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 209:
			/* StartTag[CHARACTERS[BINARY_BASE64]] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decodeUnsignedInteger16(stream, &dinSignatureValueType->CONTENT.bytesLen);
					if (errn == 0) {
						errn =  (dinSignatureValueType->CONTENT.bytesLen) <= dinSignatureValueType_CONTENT_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
					}
					if (errn == 0) {
						errn = decodeBytes(stream, dinSignatureValueType->CONTENT.bytesLen, dinSignatureValueType->CONTENT.bytes);
					}
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 4:
			/* Element[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,PaymentOptionsType',  base type name='anyType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("urn:iso:15118:2:2010:MsgDataTypes":PaymentOption{1-UNBOUNDED})',  derivedBy='RESTRICTION'.  */
static int decode_dinPaymentOptionsType(bitstream_t* stream, struct dinPaymentOptionsType* dinPaymentOptionsType) {
	int grammarID = 210;
	int done = 0;
	
	init_dinPaymentOptionsType(dinPaymentOptionsType);
	
	while(!done) {
		switch(grammarID) {
		case 210:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PaymentOption)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					if (dinPaymentOptionsType->PaymentOption.arrayLen < dinPaymentOptionsType_PaymentOption_ARRAY_SIZE) {
						/* FirstStartTag[CHARACTERS[ENUMERATION]] */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(errn == 0) {
							if(eventCode == 0) {
								errn = decodeNBitUnsignedInteger(stream, 1, &uint32);
								dinPaymentOptionsType->PaymentOption.array[dinPaymentOptionsType->PaymentOption.arrayLen] = (dinpaymentOptionType) uint32;
								dinPaymentOptionsType->PaymentOption.arrayLen++;
							} else {
								/* Second level event (e.g., xsi:type, xsi:nil, ...) */
								errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
							}
						}
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PaymentOption) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 211;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 211:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PaymentOption), END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					if (dinPaymentOptionsType->PaymentOption.arrayLen < dinPaymentOptionsType_PaymentOption_ARRAY_SIZE) {
						/* FirstStartTag[CHARACTERS[ENUMERATION]] */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(errn == 0) {
							if(eventCode == 0) {
								errn = decodeNBitUnsignedInteger(stream, 1, &uint32);
								dinPaymentOptionsType->PaymentOption.array[dinPaymentOptionsType->PaymentOption.arrayLen] = (dinpaymentOptionType) uint32;
								dinPaymentOptionsType->PaymentOption.arrayLen++;
							} else {
								/* Second level event (e.g., xsi:type, xsi:nil, ...) */
								errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
							}
						}
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PaymentOption) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 211;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 1:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceTagType',  base type name='anyType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("urn:iso:15118:2:2010:MsgDataTypes":ServiceID,"urn:iso:15118:2:2010:MsgDataTypes":ServiceName{0-1},"urn:iso:15118:2:2010:MsgDataTypes":ServiceCategory,"urn:iso:15118:2:2010:MsgDataTypes":ServiceScope{0-1})',  derivedBy='RESTRICTION'.  */
static int decode_dinServiceTagType(bitstream_t* stream, struct dinServiceTagType* dinServiceTagType) {
	int grammarID = 212;
	int done = 0;
	
	init_dinServiceTagType(dinServiceTagType);
	
	while(!done) {
		switch(grammarID) {
		case 212:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceID)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger16(stream, &dinServiceTagType->ServiceID);
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceID) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 213;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 213:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceName), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceCategory)] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[STRING]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger16(stream, &dinServiceTagType->ServiceName.charactersLen);
							if (errn == 0) {
								if (dinServiceTagType->ServiceName.charactersLen >= 2) {
									dinServiceTagType->ServiceName.charactersLen = (uint16_t)(dinServiceTagType->ServiceName.charactersLen - 2); /* string table miss */
									errn = decodeCharacters(stream, dinServiceTagType->ServiceName.charactersLen, dinServiceTagType->ServiceName.characters, dinServiceTagType_ServiceName_CHARACTERS_SIZE);
								} else {
									/* string table hit */
									errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
								}
							}
							dinServiceTagType->ServiceName_isUsed = 1u;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceName) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 214;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 1:
					/* FirstStartTag[CHARACTERS[ENUMERATION]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeNBitUnsignedInteger(stream, 2, &uint32);
							dinServiceTagType->ServiceCategory = (dinserviceCategoryType) uint32;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceCategory) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 215;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 214:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceCategory)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[ENUMERATION]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeNBitUnsignedInteger(stream, 2, &uint32);
							dinServiceTagType->ServiceCategory = (dinserviceCategoryType) uint32;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceCategory) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 215;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 215:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceScope), END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[STRING]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger16(stream, &dinServiceTagType->ServiceScope.charactersLen);
							if (errn == 0) {
								if (dinServiceTagType->ServiceScope.charactersLen >= 2) {
									dinServiceTagType->ServiceScope.charactersLen = (uint16_t)(dinServiceTagType->ServiceScope.charactersLen - 2); /* string table miss */
									errn = decodeCharacters(stream, dinServiceTagType->ServiceScope.charactersLen, dinServiceTagType->ServiceScope.characters, dinServiceTagType_ServiceScope_CHARACTERS_SIZE);
								} else {
									/* string table hit */
									errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
								}
							}
							dinServiceTagType->ServiceScope_isUsed = 1u;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceScope) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 4;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 1:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 4:
			/* Element[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,AC_EVSEStatusType',  base type name='EVSEStatusType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("urn:iso:15118:2:2010:MsgDataTypes":PowerSwitchClosed,"urn:iso:15118:2:2010:MsgDataTypes":RCD,"urn:iso:15118:2:2010:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2010:MsgDataTypes":EVSENotification)',  derivedBy='EXTENSION'.  */
static int decode_dinAC_EVSEStatusType(bitstream_t* stream, struct dinAC_EVSEStatusType* dinAC_EVSEStatusType) {
	int grammarID = 216;
	int done = 0;
	
	init_dinAC_EVSEStatusType(dinAC_EVSEStatusType);
	
	while(!done) {
		switch(grammarID) {
		case 216:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PowerSwitchClosed)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[BOOLEAN]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeBoolean(stream, &dinAC_EVSEStatusType->PowerSwitchClosed);
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PowerSwitchClosed) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 217;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 217:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RCD)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[BOOLEAN]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeBoolean(stream, &dinAC_EVSEStatusType->RCD);
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RCD) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 218;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 218:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}NotificationMaxDelay)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger32(stream, &dinAC_EVSEStatusType->NotificationMaxDelay);
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}NotificationMaxDelay) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 219;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 219:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSENotification)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[ENUMERATION]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeNBitUnsignedInteger(stream, 2, &uint32);
							dinAC_EVSEStatusType->EVSENotification = (dinEVSENotificationType) uint32;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSENotification) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 4;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 4:
			/* Element[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgBody,CertificateUpdateReqType',  base type name='BodyBaseType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("urn:iso:15118:2:2010:MsgBody":ContractSignatureCertChain,"urn:iso:15118:2:2010:MsgBody":ContractID,"urn:iso:15118:2:2010:MsgBody":ListOfRootCertificateIDs,"urn:iso:15118:2:2010:MsgBody":DHParams)',  derivedBy='EXTENSION'.  */
static int decode_dinCertificateUpdateReqType(bitstream_t* stream, struct dinCertificateUpdateReqType* dinCertificateUpdateReqType) {
	int grammarID = 220;
	int done = 0;
	
	init_dinCertificateUpdateReqType(dinCertificateUpdateReqType);
	
	while(!done) {
		switch(grammarID) {
		case 220:
			/* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureCertChain)] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decodeUnsignedInteger16(stream, &dinCertificateUpdateReqType->Id.charactersLen);
					if (errn == 0) {
						if (dinCertificateUpdateReqType->Id.charactersLen >= 2) {
							dinCertificateUpdateReqType->Id.charactersLen = (uint16_t)(dinCertificateUpdateReqType->Id.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, dinCertificateUpdateReqType->Id.charactersLen, dinCertificateUpdateReqType->Id.characters, dinCertificateUpdateReqType_Id_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					dinCertificateUpdateReqType->Id_isUsed = 1u;
					grammarID = 221;
					break;
				case 1:
					errn = decode_dinCertificateChainType(stream, &dinCertificateUpdateReqType->ContractSignatureCertChain);
					grammarID = 222;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 221:
			/* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureCertChain)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinCertificateChainType(stream, &dinCertificateUpdateReqType->ContractSignatureCertChain);
					grammarID = 222;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 222:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractID)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[STRING]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger16(stream, &dinCertificateUpdateReqType->ContractID.charactersLen);
							if (errn == 0) {
								if (dinCertificateUpdateReqType->ContractID.charactersLen >= 2) {
									dinCertificateUpdateReqType->ContractID.charactersLen = (uint16_t)(dinCertificateUpdateReqType->ContractID.charactersLen - 2); /* string table miss */
									errn = decodeCharacters(stream, dinCertificateUpdateReqType->ContractID.charactersLen, dinCertificateUpdateReqType->ContractID.characters, dinCertificateUpdateReqType_ContractID_CHARACTERS_SIZE);
								} else {
									/* string table hit */
									errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
								}
							}
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractID) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 135;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 135:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ListOfRootCertificateIDs)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinListOfRootCertificateIDsType(stream, &dinCertificateUpdateReqType->ListOfRootCertificateIDs);
					grammarID = 136;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 136:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DHParams)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[BINARY_BASE64]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger16(stream, &dinCertificateUpdateReqType->DHParams.bytesLen);
							if (errn == 0) {
								errn =  (dinCertificateUpdateReqType->DHParams.bytesLen) <= dinCertificateUpdateReqType_DHParams_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
							}
							if (errn == 0) {
								errn = decodeBytes(stream, dinCertificateUpdateReqType->DHParams.bytesLen, dinCertificateUpdateReqType->DHParams.bytes);
							}
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DHParams) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 4;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 4:
			/* Element[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgBody,ServicePaymentSelectionResType',  base type name='BodyBaseType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode)',  derivedBy='EXTENSION'.  */
static int decode_dinServicePaymentSelectionResType(bitstream_t* stream, struct dinServicePaymentSelectionResType* dinServicePaymentSelectionResType) {
	int grammarID = 223;
	int done = 0;
	
	init_dinServicePaymentSelectionResType(dinServicePaymentSelectionResType);
	
	while(!done) {
		switch(grammarID) {
		case 223:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[ENUMERATION]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeNBitUnsignedInteger(stream, 5, &uint32);
							dinServicePaymentSelectionResType->ResponseCode = (dinresponseCodeType) uint32;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 4;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 4:
			/* Element[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SAScheduleTupleType',  base type name='anyType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("urn:iso:15118:2:2010:MsgDataTypes":SAScheduleTupleID,"urn:iso:15118:2:2010:MsgDataTypes":PMaxSchedule,"urn:iso:15118:2:2010:MsgDataTypes":SalesTariff{0-1})',  derivedBy='RESTRICTION'.  */
static int decode_dinSAScheduleTupleType(bitstream_t* stream, struct dinSAScheduleTupleType* dinSAScheduleTupleType) {
	int grammarID = 224;
	int done = 0;
	
	init_dinSAScheduleTupleType(dinSAScheduleTupleType);
	
	while(!done) {
		switch(grammarID) {
		case 224:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleTupleID)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[INTEGER]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeInteger16(stream, &dinSAScheduleTupleType->SAScheduleTupleID);
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleTupleID) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 225;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 225:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMaxSchedule)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinPMaxScheduleType(stream, &dinSAScheduleTupleType->PMaxSchedule);
					grammarID = 226;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 226:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariff), END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinSalesTariffType(stream, &dinSAScheduleTupleType->SalesTariff);
					dinSAScheduleTupleType->SalesTariff_isUsed = 1u;
					grammarID = 4;
					break;
				case 1:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 4:
			/* Element[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ChargingProfileType',  base type name='anyType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("urn:iso:15118:2:2010:MsgDataTypes":SAScheduleTupleID,"urn:iso:15118:2:2010:MsgDataTypes":ProfileEntry{1-UNBOUNDED})',  derivedBy='RESTRICTION'.  */
static int decode_dinChargingProfileType(bitstream_t* stream, struct dinChargingProfileType* dinChargingProfileType) {
	int grammarID = 227;
	int done = 0;
	
	init_dinChargingProfileType(dinChargingProfileType);
	
	while(!done) {
		switch(grammarID) {
		case 227:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleTupleID)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[INTEGER]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeInteger16(stream, &dinChargingProfileType->SAScheduleTupleID);
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleTupleID) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 228;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 228:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ProfileEntry)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					if (dinChargingProfileType->ProfileEntry.arrayLen < dinChargingProfileType_ProfileEntry_ARRAY_SIZE) {
						errn = decode_dinProfileEntryType(stream, &dinChargingProfileType->ProfileEntry.array[dinChargingProfileType->ProfileEntry.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 229;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 229:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ProfileEntry), END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					if (dinChargingProfileType->ProfileEntry.arrayLen < dinChargingProfileType_ProfileEntry_ARRAY_SIZE) {
						errn = decode_dinProfileEntryType(stream, &dinChargingProfileType->ProfileEntry.array[dinChargingProfileType->ProfileEntry.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 229;
					break;
				case 1:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgBody,ServiceDiscoveryReqType',  base type name='BodyBaseType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("urn:iso:15118:2:2010:MsgBody":ServiceScope{0-1},"urn:iso:15118:2:2010:MsgBody":ServiceCategory{0-1})',  derivedBy='EXTENSION'.  */
static int decode_dinServiceDiscoveryReqType(bitstream_t* stream, struct dinServiceDiscoveryReqType* dinServiceDiscoveryReqType) {
	int grammarID = 230;
	int done = 0;
	
	init_dinServiceDiscoveryReqType(dinServiceDiscoveryReqType);
	
	while(!done) {
		switch(grammarID) {
		case 230:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceScope), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceCategory), END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[STRING]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger16(stream, &dinServiceDiscoveryReqType->ServiceScope.charactersLen);
							if (errn == 0) {
								if (dinServiceDiscoveryReqType->ServiceScope.charactersLen >= 2) {
									dinServiceDiscoveryReqType->ServiceScope.charactersLen = (uint16_t)(dinServiceDiscoveryReqType->ServiceScope.charactersLen - 2); /* string table miss */
									errn = decodeCharacters(stream, dinServiceDiscoveryReqType->ServiceScope.charactersLen, dinServiceDiscoveryReqType->ServiceScope.characters, dinServiceDiscoveryReqType_ServiceScope_CHARACTERS_SIZE);
								} else {
									/* string table hit */
									errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
								}
							}
							dinServiceDiscoveryReqType->ServiceScope_isUsed = 1u;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceScope) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 231;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 1:
					/* FirstStartTag[CHARACTERS[ENUMERATION]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeNBitUnsignedInteger(stream, 2, &uint32);
							dinServiceDiscoveryReqType->ServiceCategory = (dinserviceCategoryType) uint32;
							dinServiceDiscoveryReqType->ServiceCategory_isUsed = 1u;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceCategory) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 4;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 2:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 231:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceCategory), END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[ENUMERATION]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeNBitUnsignedInteger(stream, 2, &uint32);
							dinServiceDiscoveryReqType->ServiceCategory = (dinserviceCategoryType) uint32;
							dinServiceDiscoveryReqType->ServiceCategory_isUsed = 1u;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceCategory) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 4;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 1:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 4:
			/* Element[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,AC_EVSEChargeParameterType',  base type name='EVSEChargeParameterType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("urn:iso:15118:2:2010:MsgDataTypes":AC_EVSEStatus,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMaxVoltage,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMaxCurrent,"urn:iso:15118:2:2010:MsgDataTypes":EVSEMinCurrent)',  derivedBy='EXTENSION'.  */
static int decode_dinAC_EVSEChargeParameterType(bitstream_t* stream, struct dinAC_EVSEChargeParameterType* dinAC_EVSEChargeParameterType) {
	int grammarID = 232;
	int done = 0;
	
	init_dinAC_EVSEChargeParameterType(dinAC_EVSEChargeParameterType);
	
	while(!done) {
		switch(grammarID) {
		case 232:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVSEStatus)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinAC_EVSEStatusType(stream, &dinAC_EVSEChargeParameterType->AC_EVSEStatus);
					grammarID = 233;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 233:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaxVoltage)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinPhysicalValueType(stream, &dinAC_EVSEChargeParameterType->EVSEMaxVoltage);
					grammarID = 234;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 234:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaxCurrent)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinPhysicalValueType(stream, &dinAC_EVSEChargeParameterType->EVSEMaxCurrent);
					grammarID = 235;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 235:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMinCurrent)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinPhysicalValueType(stream, &dinAC_EVSEChargeParameterType->EVSEMinCurrent);
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 4:
			/* Element[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='http://www.w3.org/2000/09/xmldsig#,KeyInfoType',  base type name='anyType',  content type='MIXED',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("http://www.w3.org/2000/09/xmldsig#":KeyName|"http://www.w3.org/2000/09/xmldsig#":KeyValue|"http://www.w3.org/2000/09/xmldsig#":RetrievalMethod|"http://www.w3.org/2000/09/xmldsig#":X509Data|"http://www.w3.org/2000/09/xmldsig#":PGPData|"http://www.w3.org/2000/09/xmldsig#":SPKIData|"http://www.w3.org/2000/09/xmldsig#":MgmtData|(WC[##other:"http://www.w3.org/2000/09/xmldsig#"])){1-UNBOUNDED}',  derivedBy='RESTRICTION'.  */
static int decode_dinKeyInfoType(bitstream_t* stream, struct dinKeyInfoType* dinKeyInfoType) {
	int grammarID = 236;
	int done = 0;
	
	init_dinKeyInfoType(dinKeyInfoType);
	
	while(!done) {
		switch(grammarID) {
		case 236:
			/* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */
			errn = decodeNBitUnsignedInteger(stream, 4, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decodeUnsignedInteger16(stream, &dinKeyInfoType->Id.charactersLen);
					if (errn == 0) {
						if (dinKeyInfoType->Id.charactersLen >= 2) {
							dinKeyInfoType->Id.charactersLen = (uint16_t)(dinKeyInfoType->Id.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, dinKeyInfoType->Id.charactersLen, dinKeyInfoType->Id.characters, dinKeyInfoType_Id_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					dinKeyInfoType->Id_isUsed = 1u;
					grammarID = 237;
					break;
				case 1:
					if (dinKeyInfoType->KeyName.arrayLen < dinKeyInfoType_KeyName_ARRAY_SIZE) {
						/* First(xsi:type)StartTag[CHARACTERS[STRING]] */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(errn == 0) {
							if(eventCode == 0) {
								errn = decodeUnsignedInteger16(stream, &dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen);
								if (errn == 0) {
									if (dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen >= 2) {
										dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen = (uint16_t)(dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen - 2); /* string table miss */
										errn = decodeCharacters(stream, dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen, dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].characters, dinKeyInfoType_KeyName_CHARACTERS_SIZE);
									} else {
										/* string table hit */
										errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
									}
								}
								dinKeyInfoType->KeyName.arrayLen++;
							} else {
								/* Second level event (e.g., xsi:type, xsi:nil, ...) */
								errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
							}
						}
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 238;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 2:
					if (dinKeyInfoType->KeyValue.arrayLen < dinKeyInfoType_KeyValue_ARRAY_SIZE) {
						errn = decode_dinKeyValueType(stream, &dinKeyInfoType->KeyValue.array[dinKeyInfoType->KeyValue.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 238;
					break;
				case 3:
					if (dinKeyInfoType->RetrievalMethod.arrayLen < dinKeyInfoType_RetrievalMethod_ARRAY_SIZE) {
						errn = decode_dinRetrievalMethodType(stream, &dinKeyInfoType->RetrievalMethod.array[dinKeyInfoType->RetrievalMethod.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 238;
					break;
				case 4:
					if (dinKeyInfoType->X509Data.arrayLen < dinKeyInfoType_X509Data_ARRAY_SIZE) {
						errn = decode_dinX509DataType(stream, &dinKeyInfoType->X509Data.array[dinKeyInfoType->X509Data.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 238;
					break;
				case 5:
					if (dinKeyInfoType->PGPData.arrayLen < dinKeyInfoType_PGPData_ARRAY_SIZE) {
						errn = decode_dinPGPDataType(stream, &dinKeyInfoType->PGPData.array[dinKeyInfoType->PGPData.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 238;
					break;
				case 6:
					if (dinKeyInfoType->SPKIData.arrayLen < dinKeyInfoType_SPKIData_ARRAY_SIZE) {
						errn = decode_dinSPKIDataType(stream, &dinKeyInfoType->SPKIData.array[dinKeyInfoType->SPKIData.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 238;
					break;
				case 7:
					if (dinKeyInfoType->MgmtData.arrayLen < dinKeyInfoType_MgmtData_ARRAY_SIZE) {
						/* First(xsi:type)StartTag[CHARACTERS[STRING]] */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(errn == 0) {
							if(eventCode == 0) {
								errn = decodeUnsignedInteger16(stream, &dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen);
								if (errn == 0) {
									if (dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen >= 2) {
										dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen = (uint16_t)(dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen - 2); /* string table miss */
										errn = decodeCharacters(stream, dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen, dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].characters, dinKeyInfoType_MgmtData_CHARACTERS_SIZE);
									} else {
										/* string table hit */
										errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
									}
								}
								dinKeyInfoType->MgmtData.arrayLen++;
							} else {
								/* Second level event (e.g., xsi:type, xsi:nil, ...) */
								errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
							}
						}
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 238;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 8:
					errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					/* TODO unsupported event : START_ELEMENT_GENERIC */
					grammarID = 238;
					break;
				case 9:
					errn = decodeUnsignedInteger16(stream, &dinKeyInfoType->ANY.charactersLen);
					if (errn == 0) {
						if (dinKeyInfoType->ANY.charactersLen >= 2) {
							dinKeyInfoType->ANY.charactersLen = (uint16_t)(dinKeyInfoType->ANY.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, dinKeyInfoType->ANY.charactersLen, dinKeyInfoType->ANY.characters, dinKeyInfoType_ANY_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					dinKeyInfoType->ANY_isUsed = 1u;
					grammarID = 239;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 237:
			/* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */
			errn = decodeNBitUnsignedInteger(stream, 4, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					if (dinKeyInfoType->KeyName.arrayLen < dinKeyInfoType_KeyName_ARRAY_SIZE) {
						/* First(xsi:type)StartTag[CHARACTERS[STRING]] */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(errn == 0) {
							if(eventCode == 0) {
								errn = decodeUnsignedInteger16(stream, &dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen);
								if (errn == 0) {
									if (dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen >= 2) {
										dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen = (uint16_t)(dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen - 2); /* string table miss */
										errn = decodeCharacters(stream, dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen, dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].characters, dinKeyInfoType_KeyName_CHARACTERS_SIZE);
									} else {
										/* string table hit */
										errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
									}
								}
								dinKeyInfoType->KeyName.arrayLen++;
							} else {
								/* Second level event (e.g., xsi:type, xsi:nil, ...) */
								errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
							}
						}
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 238;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 1:
					if (dinKeyInfoType->KeyValue.arrayLen < dinKeyInfoType_KeyValue_ARRAY_SIZE) {
						errn = decode_dinKeyValueType(stream, &dinKeyInfoType->KeyValue.array[dinKeyInfoType->KeyValue.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 238;
					break;
				case 2:
					if (dinKeyInfoType->RetrievalMethod.arrayLen < dinKeyInfoType_RetrievalMethod_ARRAY_SIZE) {
						errn = decode_dinRetrievalMethodType(stream, &dinKeyInfoType->RetrievalMethod.array[dinKeyInfoType->RetrievalMethod.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 238;
					break;
				case 3:
					if (dinKeyInfoType->X509Data.arrayLen < dinKeyInfoType_X509Data_ARRAY_SIZE) {
						errn = decode_dinX509DataType(stream, &dinKeyInfoType->X509Data.array[dinKeyInfoType->X509Data.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 238;
					break;
				case 4:
					if (dinKeyInfoType->PGPData.arrayLen < dinKeyInfoType_PGPData_ARRAY_SIZE) {
						errn = decode_dinPGPDataType(stream, &dinKeyInfoType->PGPData.array[dinKeyInfoType->PGPData.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 238;
					break;
				case 5:
					if (dinKeyInfoType->SPKIData.arrayLen < dinKeyInfoType_SPKIData_ARRAY_SIZE) {
						errn = decode_dinSPKIDataType(stream, &dinKeyInfoType->SPKIData.array[dinKeyInfoType->SPKIData.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 238;
					break;
				case 6:
					if (dinKeyInfoType->MgmtData.arrayLen < dinKeyInfoType_MgmtData_ARRAY_SIZE) {
						/* First(xsi:type)StartTag[CHARACTERS[STRING]] */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(errn == 0) {
							if(eventCode == 0) {
								errn = decodeUnsignedInteger16(stream, &dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen);
								if (errn == 0) {
									if (dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen >= 2) {
										dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen = (uint16_t)(dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen - 2); /* string table miss */
										errn = decodeCharacters(stream, dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen, dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].characters, dinKeyInfoType_MgmtData_CHARACTERS_SIZE);
									} else {
										/* string table hit */
										errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
									}
								}
								dinKeyInfoType->MgmtData.arrayLen++;
							} else {
								/* Second level event (e.g., xsi:type, xsi:nil, ...) */
								errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
							}
						}
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 238;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 7:
					errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					/* TODO unsupported event : START_ELEMENT_GENERIC */
					grammarID = 238;
					break;
				case 8:
					errn = decodeUnsignedInteger16(stream, &dinKeyInfoType->ANY.charactersLen);
					if (errn == 0) {
						if (dinKeyInfoType->ANY.charactersLen >= 2) {
							dinKeyInfoType->ANY.charactersLen = (uint16_t)(dinKeyInfoType->ANY.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, dinKeyInfoType->ANY.charactersLen, dinKeyInfoType->ANY.characters, dinKeyInfoType_ANY_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					dinKeyInfoType->ANY_isUsed = 1u;
					grammarID = 239;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 238:
			/* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */
			errn = decodeNBitUnsignedInteger(stream, 4, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					if (dinKeyInfoType->KeyName.arrayLen < dinKeyInfoType_KeyName_ARRAY_SIZE) {
						/* First(xsi:type)StartTag[CHARACTERS[STRING]] */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(errn == 0) {
							if(eventCode == 0) {
								errn = decodeUnsignedInteger16(stream, &dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen);
								if (errn == 0) {
									if (dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen >= 2) {
										dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen = (uint16_t)(dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen - 2); /* string table miss */
										errn = decodeCharacters(stream, dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen, dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].characters, dinKeyInfoType_KeyName_CHARACTERS_SIZE);
									} else {
										/* string table hit */
										errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
									}
								}
								dinKeyInfoType->KeyName.arrayLen++;
							} else {
								/* Second level event (e.g., xsi:type, xsi:nil, ...) */
								errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
							}
						}
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 238;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 1:
					if (dinKeyInfoType->KeyValue.arrayLen < dinKeyInfoType_KeyValue_ARRAY_SIZE) {
						errn = decode_dinKeyValueType(stream, &dinKeyInfoType->KeyValue.array[dinKeyInfoType->KeyValue.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 238;
					break;
				case 2:
					if (dinKeyInfoType->RetrievalMethod.arrayLen < dinKeyInfoType_RetrievalMethod_ARRAY_SIZE) {
						errn = decode_dinRetrievalMethodType(stream, &dinKeyInfoType->RetrievalMethod.array[dinKeyInfoType->RetrievalMethod.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 238;
					break;
				case 3:
					if (dinKeyInfoType->X509Data.arrayLen < dinKeyInfoType_X509Data_ARRAY_SIZE) {
						errn = decode_dinX509DataType(stream, &dinKeyInfoType->X509Data.array[dinKeyInfoType->X509Data.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 238;
					break;
				case 4:
					if (dinKeyInfoType->PGPData.arrayLen < dinKeyInfoType_PGPData_ARRAY_SIZE) {
						errn = decode_dinPGPDataType(stream, &dinKeyInfoType->PGPData.array[dinKeyInfoType->PGPData.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 238;
					break;
				case 5:
					if (dinKeyInfoType->SPKIData.arrayLen < dinKeyInfoType_SPKIData_ARRAY_SIZE) {
						errn = decode_dinSPKIDataType(stream, &dinKeyInfoType->SPKIData.array[dinKeyInfoType->SPKIData.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 238;
					break;
				case 6:
					if (dinKeyInfoType->MgmtData.arrayLen < dinKeyInfoType_MgmtData_ARRAY_SIZE) {
						/* First(xsi:type)StartTag[CHARACTERS[STRING]] */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(errn == 0) {
							if(eventCode == 0) {
								errn = decodeUnsignedInteger16(stream, &dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen);
								if (errn == 0) {
									if (dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen >= 2) {
										dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen = (uint16_t)(dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen - 2); /* string table miss */
										errn = decodeCharacters(stream, dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen, dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].characters, dinKeyInfoType_MgmtData_CHARACTERS_SIZE);
									} else {
										/* string table hit */
										errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
									}
								}
								dinKeyInfoType->MgmtData.arrayLen++;
							} else {
								/* Second level event (e.g., xsi:type, xsi:nil, ...) */
								errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
							}
						}
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 238;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 7:
					errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					/* TODO unsupported event : START_ELEMENT_GENERIC */
					grammarID = 238;
					break;
				case 8:
					done = 1;
					grammarID = 5;
					break;
				case 9:
					errn = decodeUnsignedInteger16(stream, &dinKeyInfoType->ANY.charactersLen);
					if (errn == 0) {
						if (dinKeyInfoType->ANY.charactersLen >= 2) {
							dinKeyInfoType->ANY.charactersLen = (uint16_t)(dinKeyInfoType->ANY.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, dinKeyInfoType->ANY.charactersLen, dinKeyInfoType->ANY.characters, dinKeyInfoType_ANY_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					dinKeyInfoType->ANY_isUsed = 1u;
					grammarID = 238;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 239:
			/* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */
			errn = decodeNBitUnsignedInteger(stream, 4, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					if (dinKeyInfoType->KeyName.arrayLen < dinKeyInfoType_KeyName_ARRAY_SIZE) {
						/* First(xsi:type)StartTag[CHARACTERS[STRING]] */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(errn == 0) {
							if(eventCode == 0) {
								errn = decodeUnsignedInteger16(stream, &dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen);
								if (errn == 0) {
									if (dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen >= 2) {
										dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen = (uint16_t)(dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen - 2); /* string table miss */
										errn = decodeCharacters(stream, dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].charactersLen, dinKeyInfoType->KeyName.array[dinKeyInfoType->KeyName.arrayLen].characters, dinKeyInfoType_KeyName_CHARACTERS_SIZE);
									} else {
										/* string table hit */
										errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
									}
								}
								dinKeyInfoType->KeyName.arrayLen++;
							} else {
								/* Second level event (e.g., xsi:type, xsi:nil, ...) */
								errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
							}
						}
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 238;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 1:
					if (dinKeyInfoType->KeyValue.arrayLen < dinKeyInfoType_KeyValue_ARRAY_SIZE) {
						errn = decode_dinKeyValueType(stream, &dinKeyInfoType->KeyValue.array[dinKeyInfoType->KeyValue.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 238;
					break;
				case 2:
					if (dinKeyInfoType->RetrievalMethod.arrayLen < dinKeyInfoType_RetrievalMethod_ARRAY_SIZE) {
						errn = decode_dinRetrievalMethodType(stream, &dinKeyInfoType->RetrievalMethod.array[dinKeyInfoType->RetrievalMethod.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 238;
					break;
				case 3:
					if (dinKeyInfoType->X509Data.arrayLen < dinKeyInfoType_X509Data_ARRAY_SIZE) {
						errn = decode_dinX509DataType(stream, &dinKeyInfoType->X509Data.array[dinKeyInfoType->X509Data.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 238;
					break;
				case 4:
					if (dinKeyInfoType->PGPData.arrayLen < dinKeyInfoType_PGPData_ARRAY_SIZE) {
						errn = decode_dinPGPDataType(stream, &dinKeyInfoType->PGPData.array[dinKeyInfoType->PGPData.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 238;
					break;
				case 5:
					if (dinKeyInfoType->SPKIData.arrayLen < dinKeyInfoType_SPKIData_ARRAY_SIZE) {
						errn = decode_dinSPKIDataType(stream, &dinKeyInfoType->SPKIData.array[dinKeyInfoType->SPKIData.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 238;
					break;
				case 6:
					if (dinKeyInfoType->MgmtData.arrayLen < dinKeyInfoType_MgmtData_ARRAY_SIZE) {
						/* First(xsi:type)StartTag[CHARACTERS[STRING]] */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(errn == 0) {
							if(eventCode == 0) {
								errn = decodeUnsignedInteger16(stream, &dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen);
								if (errn == 0) {
									if (dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen >= 2) {
										dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen = (uint16_t)(dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen - 2); /* string table miss */
										errn = decodeCharacters(stream, dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].charactersLen, dinKeyInfoType->MgmtData.array[dinKeyInfoType->MgmtData.arrayLen].characters, dinKeyInfoType_MgmtData_CHARACTERS_SIZE);
									} else {
										/* string table hit */
										errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
									}
								}
								dinKeyInfoType->MgmtData.arrayLen++;
							} else {
								/* Second level event (e.g., xsi:type, xsi:nil, ...) */
								errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
							}
						}
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 238;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 7:
					errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					/* TODO unsupported event : START_ELEMENT_GENERIC */
					grammarID = 238;
					break;
				case 8:
					errn = decodeUnsignedInteger16(stream, &dinKeyInfoType->ANY.charactersLen);
					if (errn == 0) {
						if (dinKeyInfoType->ANY.charactersLen >= 2) {
							dinKeyInfoType->ANY.charactersLen = (uint16_t)(dinKeyInfoType->ANY.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, dinKeyInfoType->ANY.charactersLen, dinKeyInfoType->ANY.characters, dinKeyInfoType_ANY_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					dinKeyInfoType->ANY_isUsed = 1u;
					grammarID = 239;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgBody,PaymentDetailsReqType',  base type name='BodyBaseType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("urn:iso:15118:2:2010:MsgBody":ContractID,"urn:iso:15118:2:2010:MsgBody":ContractSignatureCertChain)',  derivedBy='EXTENSION'.  */
static int decode_dinPaymentDetailsReqType(bitstream_t* stream, struct dinPaymentDetailsReqType* dinPaymentDetailsReqType) {
	int grammarID = 240;
	int done = 0;
	
	init_dinPaymentDetailsReqType(dinPaymentDetailsReqType);
	
	while(!done) {
		switch(grammarID) {
		case 240:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractID)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[STRING]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger16(stream, &dinPaymentDetailsReqType->ContractID.charactersLen);
							if (errn == 0) {
								if (dinPaymentDetailsReqType->ContractID.charactersLen >= 2) {
									dinPaymentDetailsReqType->ContractID.charactersLen = (uint16_t)(dinPaymentDetailsReqType->ContractID.charactersLen - 2); /* string table miss */
									errn = decodeCharacters(stream, dinPaymentDetailsReqType->ContractID.charactersLen, dinPaymentDetailsReqType->ContractID.characters, dinPaymentDetailsReqType_ContractID_CHARACTERS_SIZE);
								} else {
									/* string table hit */
									errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
								}
							}
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractID) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 241;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 241:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureCertChain)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinCertificateChainType(stream, &dinPaymentDetailsReqType->ContractSignatureCertChain);
					grammarID = 4;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 4:
			/* Element[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgBody,CableCheckResType',  base type name='BodyBaseType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":DC_EVSEStatus,"urn:iso:15118:2:2010:MsgBody":EVSEProcessing)',  derivedBy='EXTENSION'.  */
static int decode_dinCableCheckResType(bitstream_t* stream, struct dinCableCheckResType* dinCableCheckResType) {
	int grammarID = 242;
	int done = 0;
	
	init_dinCableCheckResType(dinCableCheckResType);
	
	while(!done) {
		switch(grammarID) {
		case 242:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[ENUMERATION]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeNBitUnsignedInteger(stream, 5, &uint32);
							dinCableCheckResType->ResponseCode = (dinresponseCodeType) uint32;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 243;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 243:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVSEStatus)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinDC_EVSEStatusType(stream, &dinCableCheckResType->DC_EVSEStatus);
					grammarID = 17;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 17:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEProcessing)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[ENUMERATION]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeNBitUnsignedInteger(stream, 1, &uint32);
							dinCableCheckResType->EVSEProcessing = (dinEVSEProcessingType) uint32;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEProcessing) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 4;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 4:
			/* Element[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='http://www.w3.org/2000/09/xmldsig#,ObjectType',  base type name='anyType',  content type='MIXED',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='((WC[##any])){0-UNBOUNDED}',  derivedBy='RESTRICTION'.  */
static int decode_dinObjectType(bitstream_t* stream, struct dinObjectType* dinObjectType) {
	int grammarID = 244;
	int done = 0;
	
	init_dinObjectType(dinObjectType);
	
	while(!done) {
		switch(grammarID) {
		case 244:
			/* FirstStartTag[ATTRIBUTE[STRING](Encoding), ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](MimeType), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */
			errn = decodeNBitUnsignedInteger(stream, 3, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decodeUnsignedInteger16(stream, &dinObjectType->Encoding.charactersLen);
					if (errn == 0) {
						if (dinObjectType->Encoding.charactersLen >= 2) {
							dinObjectType->Encoding.charactersLen = (uint16_t)(dinObjectType->Encoding.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, dinObjectType->Encoding.charactersLen, dinObjectType->Encoding.characters, dinObjectType_Encoding_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					dinObjectType->Encoding_isUsed = 1u;
					grammarID = 245;
					break;
				case 1:
					errn = decodeUnsignedInteger16(stream, &dinObjectType->Id.charactersLen);
					if (errn == 0) {
						if (dinObjectType->Id.charactersLen >= 2) {
							dinObjectType->Id.charactersLen = (uint16_t)(dinObjectType->Id.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, dinObjectType->Id.charactersLen, dinObjectType->Id.characters, dinObjectType_Id_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					dinObjectType->Id_isUsed = 1u;
					grammarID = 246;
					break;
				case 2:
					errn = decodeUnsignedInteger16(stream, &dinObjectType->MimeType.charactersLen);
					if (errn == 0) {
						if (dinObjectType->MimeType.charactersLen >= 2) {
							dinObjectType->MimeType.charactersLen = (uint16_t)(dinObjectType->MimeType.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, dinObjectType->MimeType.charactersLen, dinObjectType->MimeType.characters, dinObjectType_MimeType_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					dinObjectType->MimeType_isUsed = 1u;
					grammarID = 19;
					break;
				case 3:
					errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					/* TODO unsupported event : START_ELEMENT_GENERIC */
					grammarID = 20;
					break;
				case 4:
					done = 1;
					grammarID = 5;
					break;
				case 5:
					errn = decodeUnsignedInteger16(stream, &dinObjectType->ANY.charactersLen);
					if (errn == 0) {
						if (dinObjectType->ANY.charactersLen >= 2) {
							dinObjectType->ANY.charactersLen = (uint16_t)(dinObjectType->ANY.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, dinObjectType->ANY.charactersLen, dinObjectType->ANY.characters, dinObjectType_ANY_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					dinObjectType->ANY_isUsed = 1u;
					grammarID = 20;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 245:
			/* StartTag[ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](MimeType), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */
			errn = decodeNBitUnsignedInteger(stream, 3, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decodeUnsignedInteger16(stream, &dinObjectType->Id.charactersLen);
					if (errn == 0) {
						if (dinObjectType->Id.charactersLen >= 2) {
							dinObjectType->Id.charactersLen = (uint16_t)(dinObjectType->Id.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, dinObjectType->Id.charactersLen, dinObjectType->Id.characters, dinObjectType_Id_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					dinObjectType->Id_isUsed = 1u;
					grammarID = 246;
					break;
				case 1:
					errn = decodeUnsignedInteger16(stream, &dinObjectType->MimeType.charactersLen);
					if (errn == 0) {
						if (dinObjectType->MimeType.charactersLen >= 2) {
							dinObjectType->MimeType.charactersLen = (uint16_t)(dinObjectType->MimeType.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, dinObjectType->MimeType.charactersLen, dinObjectType->MimeType.characters, dinObjectType_MimeType_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					dinObjectType->MimeType_isUsed = 1u;
					grammarID = 19;
					break;
				case 2:
					errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					/* TODO unsupported event : START_ELEMENT_GENERIC */
					grammarID = 20;
					break;
				case 3:
					done = 1;
					grammarID = 5;
					break;
				case 4:
					errn = decodeUnsignedInteger16(stream, &dinObjectType->ANY.charactersLen);
					if (errn == 0) {
						if (dinObjectType->ANY.charactersLen >= 2) {
							dinObjectType->ANY.charactersLen = (uint16_t)(dinObjectType->ANY.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, dinObjectType->ANY.charactersLen, dinObjectType->ANY.characters, dinObjectType_ANY_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					dinObjectType->ANY_isUsed = 1u;
					grammarID = 20;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 246:
			/* StartTag[ATTRIBUTE[STRING](MimeType), START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */
			errn = decodeNBitUnsignedInteger(stream, 3, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decodeUnsignedInteger16(stream, &dinObjectType->MimeType.charactersLen);
					if (errn == 0) {
						if (dinObjectType->MimeType.charactersLen >= 2) {
							dinObjectType->MimeType.charactersLen = (uint16_t)(dinObjectType->MimeType.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, dinObjectType->MimeType.charactersLen, dinObjectType->MimeType.characters, dinObjectType_MimeType_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					dinObjectType->MimeType_isUsed = 1u;
					grammarID = 19;
					break;
				case 1:
					errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					/* TODO unsupported event : START_ELEMENT_GENERIC */
					grammarID = 20;
					break;
				case 2:
					done = 1;
					grammarID = 5;
					break;
				case 3:
					errn = decodeUnsignedInteger16(stream, &dinObjectType->ANY.charactersLen);
					if (errn == 0) {
						if (dinObjectType->ANY.charactersLen >= 2) {
							dinObjectType->ANY.charactersLen = (uint16_t)(dinObjectType->ANY.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, dinObjectType->ANY.charactersLen, dinObjectType->ANY.characters, dinObjectType_ANY_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					dinObjectType->ANY_isUsed = 1u;
					grammarID = 20;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 19:
			/* StartTag[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					/* TODO unsupported event : START_ELEMENT_GENERIC */
					grammarID = 20;
					break;
				case 1:
					done = 1;
					grammarID = 5;
					break;
				case 2:
					errn = decodeUnsignedInteger16(stream, &dinObjectType->ANY.charactersLen);
					if (errn == 0) {
						if (dinObjectType->ANY.charactersLen >= 2) {
							dinObjectType->ANY.charactersLen = (uint16_t)(dinObjectType->ANY.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, dinObjectType->ANY.charactersLen, dinObjectType->ANY.characters, dinObjectType_ANY_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					dinObjectType->ANY_isUsed = 1u;
					grammarID = 20;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 20:
			/* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					/* TODO unsupported event : START_ELEMENT_GENERIC */
					grammarID = 20;
					break;
				case 1:
					done = 1;
					grammarID = 5;
					break;
				case 2:
					errn = decodeUnsignedInteger16(stream, &dinObjectType->ANY.charactersLen);
					if (errn == 0) {
						if (dinObjectType->ANY.charactersLen >= 2) {
							dinObjectType->ANY.charactersLen = (uint16_t)(dinObjectType->ANY.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, dinObjectType->ANY.charactersLen, dinObjectType->ANY.characters, dinObjectType_ANY_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					dinObjectType->ANY_isUsed = 1u;
					grammarID = 20;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgBody,SessionStopResType',  base type name='BodyBaseType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode)',  derivedBy='EXTENSION'.  */
static int decode_dinSessionStopResType(bitstream_t* stream, struct dinSessionStopResType* dinSessionStopResType) {
	int grammarID = 223;
	int done = 0;
	
	init_dinSessionStopResType(dinSessionStopResType);
	
	while(!done) {
		switch(grammarID) {
		case 223:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[ENUMERATION]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeNBitUnsignedInteger(stream, 5, &uint32);
							dinSessionStopResType->ResponseCode = (dinresponseCodeType) uint32;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 4;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 4:
			/* Element[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignedInfoType',  base type name='anyType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("http://www.w3.org/2000/09/xmldsig#":CanonicalizationMethod,"http://www.w3.org/2000/09/xmldsig#":SignatureMethod,"http://www.w3.org/2000/09/xmldsig#":Reference{1-UNBOUNDED})',  derivedBy='RESTRICTION'.  */
static int decode_dinSignedInfoType(bitstream_t* stream, struct dinSignedInfoType* dinSignedInfoType) {
	int grammarID = 247;
	int done = 0;
	
	init_dinSignedInfoType(dinSignedInfoType);
	
	while(!done) {
		switch(grammarID) {
		case 247:
			/* FirstStartTag[ATTRIBUTE[STRING](Id), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod)] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decodeUnsignedInteger16(stream, &dinSignedInfoType->Id.charactersLen);
					if (errn == 0) {
						if (dinSignedInfoType->Id.charactersLen >= 2) {
							dinSignedInfoType->Id.charactersLen = (uint16_t)(dinSignedInfoType->Id.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, dinSignedInfoType->Id.charactersLen, dinSignedInfoType->Id.characters, dinSignedInfoType_Id_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					dinSignedInfoType->Id_isUsed = 1u;
					grammarID = 248;
					break;
				case 1:
					errn = decode_dinCanonicalizationMethodType(stream, &dinSignedInfoType->CanonicalizationMethod);
					grammarID = 249;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 248:
			/* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinCanonicalizationMethodType(stream, &dinSignedInfoType->CanonicalizationMethod);
					grammarID = 249;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 249:
			/* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureMethod)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinSignatureMethodType(stream, &dinSignedInfoType->SignatureMethod);
					grammarID = 250;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 250:
			/* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					if (dinSignedInfoType->Reference.arrayLen < dinSignedInfoType_Reference_ARRAY_SIZE) {
						errn = decode_dinReferenceType(stream, &dinSignedInfoType->Reference.array[dinSignedInfoType->Reference.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 203;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 203:
			/* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference), END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					if (dinSignedInfoType->Reference.arrayLen < dinSignedInfoType_Reference_ARRAY_SIZE) {
						errn = decode_dinReferenceType(stream, &dinSignedInfoType->Reference.array[dinSignedInfoType->Reference.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 203;
					break;
				case 1:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SalesTariffType',  base type name='anyType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("urn:iso:15118:2:2010:MsgDataTypes":SalesTariffID,"urn:iso:15118:2:2010:MsgDataTypes":SalesTariffDescription{0-1},"urn:iso:15118:2:2010:MsgDataTypes":NumEPriceLevels,"urn:iso:15118:2:2010:MsgDataTypes":SalesTariffEntry{1-UNBOUNDED})',  derivedBy='RESTRICTION'.  */
static int decode_dinSalesTariffType(bitstream_t* stream, struct dinSalesTariffType* dinSalesTariffType) {
	int grammarID = 251;
	int done = 0;
	
	init_dinSalesTariffType(dinSalesTariffType);
	
	while(!done) {
		switch(grammarID) {
		case 251:
			/* FirstStartTag[ATTRIBUTE[STRING](Id)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decodeUnsignedInteger16(stream, &dinSalesTariffType->Id.charactersLen);
					if (errn == 0) {
						if (dinSalesTariffType->Id.charactersLen >= 2) {
							dinSalesTariffType->Id.charactersLen = (uint16_t)(dinSalesTariffType->Id.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, dinSalesTariffType->Id.charactersLen, dinSalesTariffType->Id.characters, dinSalesTariffType_Id_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					grammarID = 252;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 252:
			/* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffID)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[INTEGER]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeInteger16(stream, &dinSalesTariffType->SalesTariffID);
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffID) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 253;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 253:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffDescription), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}NumEPriceLevels)] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[STRING]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger16(stream, &dinSalesTariffType->SalesTariffDescription.charactersLen);
							if (errn == 0) {
								if (dinSalesTariffType->SalesTariffDescription.charactersLen >= 2) {
									dinSalesTariffType->SalesTariffDescription.charactersLen = (uint16_t)(dinSalesTariffType->SalesTariffDescription.charactersLen - 2); /* string table miss */
									errn = decodeCharacters(stream, dinSalesTariffType->SalesTariffDescription.charactersLen, dinSalesTariffType->SalesTariffDescription.characters, dinSalesTariffType_SalesTariffDescription_CHARACTERS_SIZE);
								} else {
									/* string table hit */
									errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
								}
							}
							dinSalesTariffType->SalesTariffDescription_isUsed = 1u;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffDescription) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 254;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 1:
					/* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeNBitUnsignedInteger(stream, 8, &(uint32));
							dinSalesTariffType->NumEPriceLevels = (uint8_t)(uint32 + 0);
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}NumEPriceLevels) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 255;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 254:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}NumEPriceLevels)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeNBitUnsignedInteger(stream, 8, &(uint32));
							dinSalesTariffType->NumEPriceLevels = (uint8_t)(uint32 + 0);
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}NumEPriceLevels) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 255;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 255:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffEntry)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					if (dinSalesTariffType->SalesTariffEntry.arrayLen < dinSalesTariffType_SalesTariffEntry_ARRAY_SIZE) {
						errn = decode_dinSalesTariffEntryType(stream, &dinSalesTariffType->SalesTariffEntry.array[dinSalesTariffType->SalesTariffEntry.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 256;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 256:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffEntry), END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					if (dinSalesTariffType->SalesTariffEntry.arrayLen < dinSalesTariffType_SalesTariffEntry_ARRAY_SIZE) {
						errn = decode_dinSalesTariffEntryType(stream, &dinSalesTariffType->SalesTariffEntry.array[dinSalesTariffType->SalesTariffEntry.arrayLen++]);
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					grammarID = 256;
					break;
				case 1:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,CostType',  base type name='anyType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("urn:iso:15118:2:2010:MsgDataTypes":costKind,"urn:iso:15118:2:2010:MsgDataTypes":amount,"urn:iso:15118:2:2010:MsgDataTypes":amountMultiplier{0-1})',  derivedBy='RESTRICTION'.  */
static int decode_dinCostType(bitstream_t* stream, struct dinCostType* dinCostType) {
	int grammarID = 257;
	int done = 0;
	
	init_dinCostType(dinCostType);
	
	while(!done) {
		switch(grammarID) {
		case 257:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}costKind)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[ENUMERATION]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeNBitUnsignedInteger(stream, 2, &uint32);
							dinCostType->costKind = (dincostKindType) uint32;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}costKind) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 258;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 258:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}amount)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger32(stream, &dinCostType->amount);
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}amount) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 259;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 259:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}amountMultiplier), END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeNBitUnsignedInteger(stream, 3, &(uint32));
							dinCostType->amountMultiplier = (int8_t)(uint32 -3);
							dinCostType->amountMultiplier_isUsed = 1u;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}amountMultiplier) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 4;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 1:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 4:
			/* Element[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,ServiceChargeType',  base type name='ServiceType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='(("urn:iso:15118:2:2010:MsgDataTypes":ServiceTag,"urn:iso:15118:2:2010:MsgDataTypes":FreeService),("urn:iso:15118:2:2010:MsgDataTypes":EnergyTransferType))',  derivedBy='EXTENSION'.  */
static int decode_dinServiceChargeType(bitstream_t* stream, struct dinServiceChargeType* dinServiceChargeType) {
	int grammarID = 260;
	int done = 0;
	
	init_dinServiceChargeType(dinServiceChargeType);
	
	while(!done) {
		switch(grammarID) {
		case 260:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceTag)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinServiceTagType(stream, &dinServiceChargeType->ServiceTag);
					grammarID = 261;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 261:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FreeService)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[BOOLEAN]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeBoolean(stream, &dinServiceChargeType->FreeService);
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FreeService) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 262;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 262:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EnergyTransferType)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[ENUMERATION]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeNBitUnsignedInteger(stream, 4, &uint32);
							dinServiceChargeType->EnergyTransferType = (dinEVSESupportedEnergyTransferType) uint32;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EnergyTransferType) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 4;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 4:
			/* Element[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,DC_EVSEStatusType',  base type name='EVSEStatusType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("urn:iso:15118:2:2010:MsgDataTypes":EVSEIsolationStatus{0-1},"urn:iso:15118:2:2010:MsgDataTypes":EVSEStatusCode,"urn:iso:15118:2:2010:MsgDataTypes":NotificationMaxDelay,"urn:iso:15118:2:2010:MsgDataTypes":EVSENotification)',  derivedBy='EXTENSION'.  */
static int decode_dinDC_EVSEStatusType(bitstream_t* stream, struct dinDC_EVSEStatusType* dinDC_EVSEStatusType) {
	int grammarID = 263;
	int done = 0;
	
	init_dinDC_EVSEStatusType(dinDC_EVSEStatusType);
	
	while(!done) {
		switch(grammarID) {
		case 263:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEIsolationStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEStatusCode)] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[ENUMERATION]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeNBitUnsignedInteger(stream, 2, &uint32);
							dinDC_EVSEStatusType->EVSEIsolationStatus = (dinisolationLevelType) uint32;
							dinDC_EVSEStatusType->EVSEIsolationStatus_isUsed = 1u;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEIsolationStatus) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 264;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 1:
					/* FirstStartTag[CHARACTERS[ENUMERATION]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeNBitUnsignedInteger(stream, 4, &uint32);
							dinDC_EVSEStatusType->EVSEStatusCode = (dinDC_EVSEStatusCodeType) uint32;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEStatusCode) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 218;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 264:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEStatusCode)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[ENUMERATION]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeNBitUnsignedInteger(stream, 4, &uint32);
							dinDC_EVSEStatusType->EVSEStatusCode = (dinDC_EVSEStatusCodeType) uint32;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEStatusCode) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 218;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 218:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}NotificationMaxDelay)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger32(stream, &dinDC_EVSEStatusType->NotificationMaxDelay);
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}NotificationMaxDelay) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 219;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 219:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSENotification)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[ENUMERATION]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeNBitUnsignedInteger(stream, 2, &uint32);
							dinDC_EVSEStatusType->EVSENotification = (dinEVSENotificationType) uint32;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSENotification) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 4;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 4:
			/* Element[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='http://www.w3.org/2000/09/xmldsig#,RetrievalMethodType',  base type name='anyType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("http://www.w3.org/2000/09/xmldsig#":Transforms{0-1})',  derivedBy='RESTRICTION'.  */
static int decode_dinRetrievalMethodType(bitstream_t* stream, struct dinRetrievalMethodType* dinRetrievalMethodType) {
	int grammarID = 265;
	int done = 0;
	
	init_dinRetrievalMethodType(dinRetrievalMethodType);
	
	while(!done) {
		switch(grammarID) {
		case 265:
			/* FirstStartTag[ATTRIBUTE[STRING](Type), ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 3, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decodeUnsignedInteger16(stream, &dinRetrievalMethodType->Type.charactersLen);
					if (errn == 0) {
						if (dinRetrievalMethodType->Type.charactersLen >= 2) {
							dinRetrievalMethodType->Type.charactersLen = (uint16_t)(dinRetrievalMethodType->Type.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, dinRetrievalMethodType->Type.charactersLen, dinRetrievalMethodType->Type.characters, dinRetrievalMethodType_Type_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					dinRetrievalMethodType->Type_isUsed = 1u;
					grammarID = 266;
					break;
				case 1:
					errn = decodeUnsignedInteger16(stream, &dinRetrievalMethodType->URI.charactersLen);
					if (errn == 0) {
						if (dinRetrievalMethodType->URI.charactersLen >= 2) {
							dinRetrievalMethodType->URI.charactersLen = (uint16_t)(dinRetrievalMethodType->URI.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, dinRetrievalMethodType->URI.charactersLen, dinRetrievalMethodType->URI.characters, dinRetrievalMethodType_URI_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					dinRetrievalMethodType->URI_isUsed = 1u;
					grammarID = 267;
					break;
				case 2:
					errn = decode_dinTransformsType(stream, &dinRetrievalMethodType->Transforms);
					dinRetrievalMethodType->Transforms_isUsed = 1u;
					grammarID = 4;
					break;
				case 3:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 266:
			/* StartTag[ATTRIBUTE[STRING](URI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decodeUnsignedInteger16(stream, &dinRetrievalMethodType->URI.charactersLen);
					if (errn == 0) {
						if (dinRetrievalMethodType->URI.charactersLen >= 2) {
							dinRetrievalMethodType->URI.charactersLen = (uint16_t)(dinRetrievalMethodType->URI.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, dinRetrievalMethodType->URI.charactersLen, dinRetrievalMethodType->URI.characters, dinRetrievalMethodType_URI_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					dinRetrievalMethodType->URI_isUsed = 1u;
					grammarID = 267;
					break;
				case 1:
					errn = decode_dinTransformsType(stream, &dinRetrievalMethodType->Transforms);
					dinRetrievalMethodType->Transforms_isUsed = 1u;
					grammarID = 4;
					break;
				case 2:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 267:
			/* StartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinTransformsType(stream, &dinRetrievalMethodType->Transforms);
					dinRetrievalMethodType->Transforms_isUsed = 1u;
					grammarID = 4;
					break;
				case 1:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 4:
			/* Element[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,NotificationType',  base type name='anyType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("urn:iso:15118:2:2010:MsgDataTypes":FaultCode,"urn:iso:15118:2:2010:MsgDataTypes":FaultMsg{0-1})',  derivedBy='RESTRICTION'.  */
static int decode_dinNotificationType(bitstream_t* stream, struct dinNotificationType* dinNotificationType) {
	int grammarID = 268;
	int done = 0;
	
	init_dinNotificationType(dinNotificationType);
	
	while(!done) {
		switch(grammarID) {
		case 268:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FaultCode)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[ENUMERATION]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeNBitUnsignedInteger(stream, 2, &uint32);
							dinNotificationType->FaultCode = (dinfaultCodeType) uint32;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FaultCode) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 269;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 269:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FaultMsg), END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[STRING]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger16(stream, &dinNotificationType->FaultMsg.charactersLen);
							if (errn == 0) {
								if (dinNotificationType->FaultMsg.charactersLen >= 2) {
									dinNotificationType->FaultMsg.charactersLen = (uint16_t)(dinNotificationType->FaultMsg.charactersLen - 2); /* string table miss */
									errn = decodeCharacters(stream, dinNotificationType->FaultMsg.charactersLen, dinNotificationType->FaultMsg.characters, dinNotificationType_FaultMsg_CHARACTERS_SIZE);
								} else {
									/* string table hit */
									errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
								}
							}
							dinNotificationType->FaultMsg_isUsed = 1u;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FaultMsg) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 4;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 1:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 4:
			/* Element[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='http://www.w3.org/2000/09/xmldsig#,PGPDataType',  base type name='anyType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='(("http://www.w3.org/2000/09/xmldsig#":PGPKeyID,"http://www.w3.org/2000/09/xmldsig#":PGPKeyPacket{0-1},(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED})|("http://www.w3.org/2000/09/xmldsig#":PGPKeyPacket,(WC[##other:"http://www.w3.org/2000/09/xmldsig#"]){0-UNBOUNDED}))',  derivedBy='RESTRICTION'.  */
static int decode_dinPGPDataType(bitstream_t* stream, struct dinPGPDataType* dinPGPDataType) {
	int grammarID = 270;
	int done = 0;
	
	init_dinPGPDataType(dinPGPDataType);
	
	while(!done) {
		switch(grammarID) {
		case 270:
			/* FirstStartTag[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyID), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket)] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger16(stream, &dinPGPDataType->PGPKeyID.bytesLen);
							if (errn == 0) {
								errn =  (dinPGPDataType->PGPKeyID.bytesLen) <= dinPGPDataType_PGPKeyID_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
							}
							if (errn == 0) {
								errn = decodeBytes(stream, dinPGPDataType->PGPKeyID.bytesLen, dinPGPDataType->PGPKeyID.bytes);
							}
							dinPGPDataType->PGPKeyID_isUsed = 1u;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyID) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 271;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 1:
					/* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger16(stream, &dinPGPDataType->PGPKeyPacket.bytesLen);
							if (errn == 0) {
								errn =  (dinPGPDataType->PGPKeyPacket.bytesLen) <= dinPGPDataType_PGPKeyPacket_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
							}
							if (errn == 0) {
								errn = decodeBytes(stream, dinPGPDataType->PGPKeyPacket.bytesLen, dinPGPDataType->PGPKeyPacket.bytes);
							}
							dinPGPDataType->PGPKeyPacket_isUsed = 1u;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 272;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 271:
			/* Element[START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket), START_ELEMENT_GENERIC, END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger16(stream, &dinPGPDataType->PGPKeyPacket.bytesLen);
							if (errn == 0) {
								errn =  (dinPGPDataType->PGPKeyPacket.bytesLen) <= dinPGPDataType_PGPKeyPacket_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
							}
							if (errn == 0) {
								errn = decodeBytes(stream, dinPGPDataType->PGPKeyPacket.bytesLen, dinPGPDataType->PGPKeyPacket.bytes);
							}
							dinPGPDataType->PGPKeyPacket_isUsed = 1u;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 272;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 1:
					errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					/* TODO unsupported event : START_ELEMENT_GENERIC */
					grammarID = 272;
					break;
				case 2:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 272:
			/* Element[START_ELEMENT_GENERIC, END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					/* TODO unsupported event : START_ELEMENT_GENERIC */
					grammarID = 272;
					break;
				case 1:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgBody,CertificateInstallationResType',  base type name='BodyBaseType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("urn:iso:15118:2:2010:MsgBody":ResponseCode,"urn:iso:15118:2:2010:MsgBody":ContractSignatureCertChain,"urn:iso:15118:2:2010:MsgBody":ContractSignatureEncryptedPrivateKey,"urn:iso:15118:2:2010:MsgBody":DHParams,"urn:iso:15118:2:2010:MsgBody":ContractID)',  derivedBy='EXTENSION'.  */
static int decode_dinCertificateInstallationResType(bitstream_t* stream, struct dinCertificateInstallationResType* dinCertificateInstallationResType) {
	int grammarID = 273;
	int done = 0;
	
	init_dinCertificateInstallationResType(dinCertificateInstallationResType);
	
	while(!done) {
		switch(grammarID) {
		case 273:
			/* FirstStartTag[ATTRIBUTE[STRING](Id)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decodeUnsignedInteger16(stream, &dinCertificateInstallationResType->Id.charactersLen);
					if (errn == 0) {
						if (dinCertificateInstallationResType->Id.charactersLen >= 2) {
							dinCertificateInstallationResType->Id.charactersLen = (uint16_t)(dinCertificateInstallationResType->Id.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, dinCertificateInstallationResType->Id.charactersLen, dinCertificateInstallationResType->Id.characters, dinCertificateInstallationResType_Id_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					grammarID = 274;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 274:
			/* StartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[ENUMERATION]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeNBitUnsignedInteger(stream, 5, &uint32);
							dinCertificateInstallationResType->ResponseCode = (dinresponseCodeType) uint32;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 275;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 275:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureCertChain)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinCertificateChainType(stream, &dinCertificateInstallationResType->ContractSignatureCertChain);
					grammarID = 276;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 276:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureEncryptedPrivateKey)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[BINARY_BASE64]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger16(stream, &dinCertificateInstallationResType->ContractSignatureEncryptedPrivateKey.bytesLen);
							if (errn == 0) {
								errn =  (dinCertificateInstallationResType->ContractSignatureEncryptedPrivateKey.bytesLen) <= dinCertificateInstallationResType_ContractSignatureEncryptedPrivateKey_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
							}
							if (errn == 0) {
								errn = decodeBytes(stream, dinCertificateInstallationResType->ContractSignatureEncryptedPrivateKey.bytesLen, dinCertificateInstallationResType->ContractSignatureEncryptedPrivateKey.bytes);
							}
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureEncryptedPrivateKey) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 277;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 277:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DHParams)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[BINARY_BASE64]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger16(stream, &dinCertificateInstallationResType->DHParams.bytesLen);
							if (errn == 0) {
								errn =  (dinCertificateInstallationResType->DHParams.bytesLen) <= dinCertificateInstallationResType_DHParams_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
							}
							if (errn == 0) {
								errn = decodeBytes(stream, dinCertificateInstallationResType->DHParams.bytesLen, dinCertificateInstallationResType->DHParams.bytes);
							}
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DHParams) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 278;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 278:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractID)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[STRING]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger16(stream, &dinCertificateInstallationResType->ContractID.charactersLen);
							if (errn == 0) {
								if (dinCertificateInstallationResType->ContractID.charactersLen >= 2) {
									dinCertificateInstallationResType->ContractID.charactersLen = (uint16_t)(dinCertificateInstallationResType->ContractID.charactersLen - 2); /* string table miss */
									errn = decodeCharacters(stream, dinCertificateInstallationResType->ContractID.charactersLen, dinCertificateInstallationResType->ContractID.characters, dinCertificateInstallationResType_ContractID_CHARACTERS_SIZE);
								} else {
									/* string table hit */
									errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
								}
							}
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractID) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 4;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 4:
			/* Element[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='http://www.w3.org/2000/09/xmldsig#,SignaturePropertyType',  base type name='anyType',  content type='MIXED',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='((WC[##other:"http://www.w3.org/2000/09/xmldsig#"])){1-UNBOUNDED}',  derivedBy='RESTRICTION'.  */
static int decode_dinSignaturePropertyType(bitstream_t* stream, struct dinSignaturePropertyType* dinSignaturePropertyType) {
	int grammarID = 279;
	int done = 0;
	
	init_dinSignaturePropertyType(dinSignaturePropertyType);
	
	while(!done) {
		switch(grammarID) {
		case 279:
			/* FirstStartTag[ATTRIBUTE[STRING](Id), ATTRIBUTE[STRING](Target)] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decodeUnsignedInteger16(stream, &dinSignaturePropertyType->Id.charactersLen);
					if (errn == 0) {
						if (dinSignaturePropertyType->Id.charactersLen >= 2) {
							dinSignaturePropertyType->Id.charactersLen = (uint16_t)(dinSignaturePropertyType->Id.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, dinSignaturePropertyType->Id.charactersLen, dinSignaturePropertyType->Id.characters, dinSignaturePropertyType_Id_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					dinSignaturePropertyType->Id_isUsed = 1u;
					grammarID = 280;
					break;
				case 1:
					errn = decodeUnsignedInteger16(stream, &dinSignaturePropertyType->Target.charactersLen);
					if (errn == 0) {
						if (dinSignaturePropertyType->Target.charactersLen >= 2) {
							dinSignaturePropertyType->Target.charactersLen = (uint16_t)(dinSignaturePropertyType->Target.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, dinSignaturePropertyType->Target.charactersLen, dinSignaturePropertyType->Target.characters, dinSignaturePropertyType_Target_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					grammarID = 281;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 280:
			/* StartTag[ATTRIBUTE[STRING](Target)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decodeUnsignedInteger16(stream, &dinSignaturePropertyType->Target.charactersLen);
					if (errn == 0) {
						if (dinSignaturePropertyType->Target.charactersLen >= 2) {
							dinSignaturePropertyType->Target.charactersLen = (uint16_t)(dinSignaturePropertyType->Target.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, dinSignaturePropertyType->Target.charactersLen, dinSignaturePropertyType->Target.characters, dinSignaturePropertyType_Target_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					grammarID = 281;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 281:
			/* StartTag[START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					/* TODO unsupported event : START_ELEMENT_GENERIC */
					grammarID = 20;
					break;
				case 1:
					errn = decodeUnsignedInteger16(stream, &dinSignaturePropertyType->ANY.charactersLen);
					if (errn == 0) {
						if (dinSignaturePropertyType->ANY.charactersLen >= 2) {
							dinSignaturePropertyType->ANY.charactersLen = (uint16_t)(dinSignaturePropertyType->ANY.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, dinSignaturePropertyType->ANY.charactersLen, dinSignaturePropertyType->ANY.characters, dinSignaturePropertyType_ANY_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					dinSignaturePropertyType->ANY_isUsed = 1u;
					grammarID = 282;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 20:
			/* Element[START_ELEMENT_GENERIC, END_ELEMENT, CHARACTERS_GENERIC[STRING]] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					/* TODO unsupported event : START_ELEMENT_GENERIC */
					grammarID = 20;
					break;
				case 1:
					done = 1;
					grammarID = 5;
					break;
				case 2:
					errn = decodeUnsignedInteger16(stream, &dinSignaturePropertyType->ANY.charactersLen);
					if (errn == 0) {
						if (dinSignaturePropertyType->ANY.charactersLen >= 2) {
							dinSignaturePropertyType->ANY.charactersLen = (uint16_t)(dinSignaturePropertyType->ANY.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, dinSignaturePropertyType->ANY.charactersLen, dinSignaturePropertyType->ANY.characters, dinSignaturePropertyType_ANY_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					dinSignaturePropertyType->ANY_isUsed = 1u;
					grammarID = 20;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 282:
			/* Element[START_ELEMENT_GENERIC, CHARACTERS_GENERIC[STRING]] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					/* TODO unsupported event : START_ELEMENT_GENERIC */
					grammarID = 20;
					break;
				case 1:
					errn = decodeUnsignedInteger16(stream, &dinSignaturePropertyType->ANY.charactersLen);
					if (errn == 0) {
						if (dinSignaturePropertyType->ANY.charactersLen >= 2) {
							dinSignaturePropertyType->ANY.charactersLen = (uint16_t)(dinSignaturePropertyType->ANY.charactersLen - 2); /* string table miss */
							errn = decodeCharacters(stream, dinSignaturePropertyType->ANY.charactersLen, dinSignaturePropertyType->ANY.characters, dinSignaturePropertyType_ANY_CHARACTERS_SIZE);
						} else {
							/* string table hit */
							errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
						}
					}
					dinSignaturePropertyType->ANY_isUsed = 1u;
					grammarID = 282;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,MeterInfoType',  base type name='anyType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("urn:iso:15118:2:2010:MsgDataTypes":MeterID,"urn:iso:15118:2:2010:MsgDataTypes":MeterReading{0-1},"urn:iso:15118:2:2010:MsgDataTypes":SigMeterReading{0-1},"urn:iso:15118:2:2010:MsgDataTypes":MeterStatus{0-1},"urn:iso:15118:2:2010:MsgDataTypes":TMeter{0-1})',  derivedBy='RESTRICTION'.  */
static int decode_dinMeterInfoType(bitstream_t* stream, struct dinMeterInfoType* dinMeterInfoType) {
	int grammarID = 283;
	int done = 0;
	
	init_dinMeterInfoType(dinMeterInfoType);
	
	while(!done) {
		switch(grammarID) {
		case 283:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterID)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[STRING]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger16(stream, &dinMeterInfoType->MeterID.charactersLen);
							if (errn == 0) {
								if (dinMeterInfoType->MeterID.charactersLen >= 2) {
									dinMeterInfoType->MeterID.charactersLen = (uint16_t)(dinMeterInfoType->MeterID.charactersLen - 2); /* string table miss */
									errn = decodeCharacters(stream, dinMeterInfoType->MeterID.charactersLen, dinMeterInfoType->MeterID.characters, dinMeterInfoType_MeterID_CHARACTERS_SIZE);
								} else {
									/* string table hit */
									errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
								}
							}
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterID) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 284;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 284:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterReading), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SigMeterReading), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TMeter), END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 3, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					errn = decode_dinPhysicalValueType(stream, &dinMeterInfoType->MeterReading);
					dinMeterInfoType->MeterReading_isUsed = 1u;
					grammarID = 285;
					break;
				case 1:
					/* FirstStartTag[CHARACTERS[BINARY_BASE64]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger16(stream, &dinMeterInfoType->SigMeterReading.bytesLen);
							if (errn == 0) {
								errn =  (dinMeterInfoType->SigMeterReading.bytesLen) <= dinMeterInfoType_SigMeterReading_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
							}
							if (errn == 0) {
								errn = decodeBytes(stream, dinMeterInfoType->SigMeterReading.bytesLen, dinMeterInfoType->SigMeterReading.bytes);
							}
							dinMeterInfoType->SigMeterReading_isUsed = 1u;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SigMeterReading) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 286;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 2:
					/* FirstStartTag[CHARACTERS[INTEGER]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeInteger16(stream, &dinMeterInfoType->MeterStatus);
							dinMeterInfoType->MeterStatus_isUsed = 1u;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterStatus) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 287;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 3:
					/* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeInteger64(stream, &dinMeterInfoType->TMeter);
							dinMeterInfoType->TMeter_isUsed = 1u;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TMeter) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 4;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 4:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 285:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SigMeterReading), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TMeter), END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 3, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[BINARY_BASE64]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeUnsignedInteger16(stream, &dinMeterInfoType->SigMeterReading.bytesLen);
							if (errn == 0) {
								errn =  (dinMeterInfoType->SigMeterReading.bytesLen) <= dinMeterInfoType_SigMeterReading_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
							}
							if (errn == 0) {
								errn = decodeBytes(stream, dinMeterInfoType->SigMeterReading.bytesLen, dinMeterInfoType->SigMeterReading.bytes);
							}
							dinMeterInfoType->SigMeterReading_isUsed = 1u;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SigMeterReading) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 286;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 1:
					/* FirstStartTag[CHARACTERS[INTEGER]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeInteger16(stream, &dinMeterInfoType->MeterStatus);
							dinMeterInfoType->MeterStatus_isUsed = 1u;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterStatus) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 287;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 2:
					/* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeInteger64(stream, &dinMeterInfoType->TMeter);
							dinMeterInfoType->TMeter_isUsed = 1u;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TMeter) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 4;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 3:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 286:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TMeter), END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* FirstStartTag[CHARACTERS[INTEGER]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeInteger16(stream, &dinMeterInfoType->MeterStatus);
							dinMeterInfoType->MeterStatus_isUsed = 1u;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterStatus) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 287;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 1:
					/* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeInteger64(stream, &dinMeterInfoType->TMeter);
							dinMeterInfoType->TMeter_isUsed = 1u;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TMeter) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 4;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 2:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 287:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TMeter), END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					/* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */
					errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
					if(errn == 0) {
						if(eventCode == 0) {
							errn = decodeInteger64(stream, &dinMeterInfoType->TMeter);
							dinMeterInfoType->TMeter_isUsed = 1u;
						} else {
							/* Second level event (e.g., xsi:type, xsi:nil, ...) */
							errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
						}
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TMeter) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 4;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 1:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 4:
			/* Element[END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}

/* Complex type name='urn:iso:15118:2:2010:MsgDataTypes,SubCertificatesType',  base type name='anyType',  content type='ELEMENT',  isAbstract='false',  hasTypeId='false',  final='0',  block='0',  particle='("urn:iso:15118:2:2010:MsgDataTypes":Certificate{1-UNBOUNDED})',  derivedBy='RESTRICTION'.  */
static int decode_dinSubCertificatesType(bitstream_t* stream, struct dinSubCertificatesType* dinSubCertificatesType) {
	int grammarID = 288;
	int done = 0;
	
	init_dinSubCertificatesType(dinSubCertificatesType);
	
	while(!done) {
		switch(grammarID) {
		case 288:
			/* FirstStartTag[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Certificate)] */
			errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					if (dinSubCertificatesType->Certificate.arrayLen < dinSubCertificatesType_Certificate_ARRAY_SIZE) {
						/* FirstStartTag[CHARACTERS[BINARY_BASE64]] */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(errn == 0) {
							if(eventCode == 0) {
								errn = decodeUnsignedInteger16(stream, &dinSubCertificatesType->Certificate.array[dinSubCertificatesType->Certificate.arrayLen].bytesLen);
								if (errn == 0) {
									errn =  (dinSubCertificatesType->Certificate.array[dinSubCertificatesType->Certificate.arrayLen].bytesLen) <= dinSubCertificatesType_Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
								}
								if (errn == 0) {
									errn = decodeBytes(stream, dinSubCertificatesType->Certificate.array[dinSubCertificatesType->Certificate.arrayLen].bytesLen, dinSubCertificatesType->Certificate.array[dinSubCertificatesType->Certificate.arrayLen].bytes);
								}
								dinSubCertificatesType->Certificate.arrayLen++;
							} else {
								/* Second level event (e.g., xsi:type, xsi:nil, ...) */
								errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
							}
						}
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Certificate) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 289;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		case 289:
			/* Element[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Certificate), END_ELEMENT] */
			errn = decodeNBitUnsignedInteger(stream, 2, &eventCode);
			if (errn == 0) {
				switch(eventCode) {
				case 0:
					if (dinSubCertificatesType->Certificate.arrayLen < dinSubCertificatesType_Certificate_ARRAY_SIZE) {
						/* FirstStartTag[CHARACTERS[BINARY_BASE64]] */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(errn == 0) {
							if(eventCode == 0) {
								errn = decodeUnsignedInteger16(stream, &dinSubCertificatesType->Certificate.array[dinSubCertificatesType->Certificate.arrayLen].bytesLen);
								if (errn == 0) {
									errn =  (dinSubCertificatesType->Certificate.array[dinSubCertificatesType->Certificate.arrayLen].bytesLen) <= dinSubCertificatesType_Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
								}
								if (errn == 0) {
									errn = decodeBytes(stream, dinSubCertificatesType->Certificate.array[dinSubCertificatesType->Certificate.arrayLen].bytesLen, dinSubCertificatesType->Certificate.array[dinSubCertificatesType->Certificate.arrayLen].bytes);
								}
								dinSubCertificatesType->Certificate.arrayLen++;
							} else {
								/* Second level event (e.g., xsi:type, xsi:nil, ...) */
								errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
							}
						}
					} else { 
						errn = EXI_ERROR_OUT_OF_BOUNDS;
					}
					if(errn == 0) {
						/* valid EE for simple element START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Certificate) ? */
						errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
						if(eventCode == 0) {
						grammarID = 289;
						} else {
							errn = EXI_DEVIANT_SUPPORT_NOT_DEPLOYED; /* or also typecast and nillable */
						}
					}
					break;
				case 1:
					done = 1;
					grammarID = 5;
					break;
				default:
					errn = EXI_ERROR_UNKOWN_EVENT_CODE;
					break;
				}
			}
			break;
		default:
			errn = EXI_ERROR_UNKOWN_GRAMMAR_ID;
			break;
		}
		if(errn) {
			done = 1;
		}
	}
	return errn;
}




int decode_dinExiDocument(bitstream_t* stream, struct dinEXIDocument* exiDoc) {
	errn = readEXIHeader(stream);

	if(errn == 0) {
		/* DocContent[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDef}BodyElement), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CableCheckReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CableCheckRes), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateInstallationReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateInstallationRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateUpdateReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateUpdateRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargeParameterDiscoveryReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargeParameterDiscoveryRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingStatusReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingStatusRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractAuthenticationReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractAuthenticationRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CurrentDemandReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CurrentDemandRes), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVPowerDeliveryParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVStatus), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DSAKeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestValue), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVPowerDeliveryParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Entry), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyInfo), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Manifest), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeteringReceiptReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeteringReceiptRes), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Object), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMaxScheduleEntry), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PaymentDetailsReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PaymentDetailsRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PowerDeliveryReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PowerDeliveryRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PreChargeReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PreChargeRes), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RSAKeyValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RelativeTimeInterval), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleList), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SASchedules), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffEntry), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceCharge), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDetailReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDetailRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDiscoveryReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDiscoveryRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServicePaymentSelectionReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServicePaymentSelectionRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionSetupReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionSetupRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionStopReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionStopRes), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Signature), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperties), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignedInfo), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TimeInterval), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({urn:iso:15118:2:2010:MsgDef}V2G_Message), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}WeldingDetectionReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}WeldingDetectionRes), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT_GENERIC] */
		init_dinEXIDocument(exiDoc);
		errn = decodeNBitUnsignedInteger(stream, 7, &eventCode);
		if(errn == 0) {
			switch(eventCode) {
			case 0:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVChargeParameter) */
				errn = decode_dinAC_EVChargeParameterType(stream, &exiDoc->AC_EVChargeParameter);
				exiDoc->AC_EVChargeParameter_isUsed = 1u;
				break;
			case 1:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVSEChargeParameter) */
				errn = decode_dinAC_EVSEChargeParameterType(stream, &exiDoc->AC_EVSEChargeParameter);
				exiDoc->AC_EVSEChargeParameter_isUsed = 1u;
				break;
			case 2:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVSEStatus) */
				errn = decode_dinAC_EVSEStatusType(stream, &exiDoc->AC_EVSEStatus);
				exiDoc->AC_EVSEStatus_isUsed = 1u;
				break;
			case 3:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDef}BodyElement) */
				errn = decode_dinBodyBaseType(stream, &exiDoc->BodyElement);
				exiDoc->BodyElement_isUsed = 1u;
				break;
			case 4:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CableCheckReq) */
				errn = decode_dinCableCheckReqType(stream, &exiDoc->CableCheckReq);
				exiDoc->CableCheckReq_isUsed = 1u;
				break;
			case 5:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CableCheckRes) */
				errn = decode_dinCableCheckResType(stream, &exiDoc->CableCheckRes);
				exiDoc->CableCheckRes_isUsed = 1u;
				break;
			case 6:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod) */
				errn = decode_dinCanonicalizationMethodType(stream, &exiDoc->CanonicalizationMethod);
				exiDoc->CanonicalizationMethod_isUsed = 1u;
				break;
			case 7:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateInstallationReq) */
				errn = decode_dinCertificateInstallationReqType(stream, &exiDoc->CertificateInstallationReq);
				exiDoc->CertificateInstallationReq_isUsed = 1u;
				break;
			case 8:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateInstallationRes) */
				errn = decode_dinCertificateInstallationResType(stream, &exiDoc->CertificateInstallationRes);
				exiDoc->CertificateInstallationRes_isUsed = 1u;
				break;
			case 9:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateUpdateReq) */
				errn = decode_dinCertificateUpdateReqType(stream, &exiDoc->CertificateUpdateReq);
				exiDoc->CertificateUpdateReq_isUsed = 1u;
				break;
			case 10:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateUpdateRes) */
				errn = decode_dinCertificateUpdateResType(stream, &exiDoc->CertificateUpdateRes);
				exiDoc->CertificateUpdateRes_isUsed = 1u;
				break;
			case 11:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargeParameterDiscoveryReq) */
				errn = decode_dinChargeParameterDiscoveryReqType(stream, &exiDoc->ChargeParameterDiscoveryReq);
				exiDoc->ChargeParameterDiscoveryReq_isUsed = 1u;
				break;
			case 12:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargeParameterDiscoveryRes) */
				errn = decode_dinChargeParameterDiscoveryResType(stream, &exiDoc->ChargeParameterDiscoveryRes);
				exiDoc->ChargeParameterDiscoveryRes_isUsed = 1u;
				break;
			case 13:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingStatusReq) */
				errn = decode_dinChargingStatusReqType(stream, &exiDoc->ChargingStatusReq);
				exiDoc->ChargingStatusReq_isUsed = 1u;
				break;
			case 14:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingStatusRes) */
				errn = decode_dinChargingStatusResType(stream, &exiDoc->ChargingStatusRes);
				exiDoc->ChargingStatusRes_isUsed = 1u;
				break;
			case 15:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractAuthenticationReq) */
				errn = decode_dinContractAuthenticationReqType(stream, &exiDoc->ContractAuthenticationReq);
				exiDoc->ContractAuthenticationReq_isUsed = 1u;
				break;
			case 16:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractAuthenticationRes) */
				errn = decode_dinContractAuthenticationResType(stream, &exiDoc->ContractAuthenticationRes);
				exiDoc->ContractAuthenticationRes_isUsed = 1u;
				break;
			case 17:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CurrentDemandReq) */
				errn = decode_dinCurrentDemandReqType(stream, &exiDoc->CurrentDemandReq);
				exiDoc->CurrentDemandReq_isUsed = 1u;
				break;
			case 18:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CurrentDemandRes) */
				errn = decode_dinCurrentDemandResType(stream, &exiDoc->CurrentDemandRes);
				exiDoc->CurrentDemandRes_isUsed = 1u;
				break;
			case 19:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVChargeParameter) */
				errn = decode_dinDC_EVChargeParameterType(stream, &exiDoc->DC_EVChargeParameter);
				exiDoc->DC_EVChargeParameter_isUsed = 1u;
				break;
			case 20:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVPowerDeliveryParameter) */
				errn = decode_dinDC_EVPowerDeliveryParameterType(stream, &exiDoc->DC_EVPowerDeliveryParameter);
				exiDoc->DC_EVPowerDeliveryParameter_isUsed = 1u;
				break;
			case 21:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVSEChargeParameter) */
				errn = decode_dinDC_EVSEChargeParameterType(stream, &exiDoc->DC_EVSEChargeParameter);
				exiDoc->DC_EVSEChargeParameter_isUsed = 1u;
				break;
			case 22:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVSEStatus) */
				errn = decode_dinDC_EVSEStatusType(stream, &exiDoc->DC_EVSEStatus);
				exiDoc->DC_EVSEStatus_isUsed = 1u;
				break;
			case 23:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVStatus) */
				errn = decode_dinDC_EVStatusType(stream, &exiDoc->DC_EVStatus);
				exiDoc->DC_EVStatus_isUsed = 1u;
				break;
			case 24:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DSAKeyValue) */
				errn = decode_dinDSAKeyValueType(stream, &exiDoc->DSAKeyValue);
				exiDoc->DSAKeyValue_isUsed = 1u;
				break;
			case 25:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod) */
				errn = decode_dinDigestMethodType(stream, &exiDoc->DigestMethod);
				exiDoc->DigestMethod_isUsed = 1u;
				break;
			case 26:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestValue) */
				/* FirstStartTag[CHARACTERS[BINARY_BASE64]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeUnsignedInteger16(stream, &exiDoc->DigestValue.bytesLen);
						if (errn == 0) {
							errn =  (exiDoc->DigestValue.bytesLen) <= dinEXIDocument_DigestValue_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
						}
						if (errn == 0) {
							errn = decodeBytes(stream, exiDoc->DigestValue.bytesLen, exiDoc->DigestValue.bytes);
						}
						exiDoc->DigestValue_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 27:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVChargeParameter) */
				errn = decode_dinEVChargeParameterType(stream, &exiDoc->EVChargeParameter);
				exiDoc->EVChargeParameter_isUsed = 1u;
				break;
			case 28:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVPowerDeliveryParameter) */
				errn = decode_dinEVPowerDeliveryParameterType(stream, &exiDoc->EVPowerDeliveryParameter);
				exiDoc->EVPowerDeliveryParameter_isUsed = 1u;
				break;
			case 29:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEChargeParameter) */
				errn = decode_dinEVSEChargeParameterType(stream, &exiDoc->EVSEChargeParameter);
				exiDoc->EVSEChargeParameter_isUsed = 1u;
				break;
			case 30:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEStatus) */
				errn = decode_dinEVSEStatusType(stream, &exiDoc->EVSEStatus);
				exiDoc->EVSEStatus_isUsed = 1u;
				break;
			case 31:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVStatus) */
				errn = decode_dinEVStatusType(stream, &exiDoc->EVStatus);
				exiDoc->EVStatus_isUsed = 1u;
				break;
			case 32:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Entry) */
				errn = decode_dinEntryType(stream, &exiDoc->Entry);
				exiDoc->Entry_isUsed = 1u;
				break;
			case 33:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyInfo) */
				errn = decode_dinKeyInfoType(stream, &exiDoc->KeyInfo);
				exiDoc->KeyInfo_isUsed = 1u;
				break;
			case 34:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName) */
				/* First(xsi:type)StartTag[CHARACTERS[STRING]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeUnsignedInteger16(stream, &exiDoc->KeyName.charactersLen);
						if (errn == 0) {
							if (exiDoc->KeyName.charactersLen >= 2) {
								exiDoc->KeyName.charactersLen = (uint16_t)(exiDoc->KeyName.charactersLen - 2); /* string table miss */
								errn = decodeCharacters(stream, exiDoc->KeyName.charactersLen, exiDoc->KeyName.characters, dinEXIDocument_KeyName_CHARACTERS_SIZE);
							} else {
								/* string table hit */
								errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
							}
						}
						exiDoc->KeyName_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 35:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue) */
				errn = decode_dinKeyValueType(stream, &exiDoc->KeyValue);
				exiDoc->KeyValue_isUsed = 1u;
				break;
			case 36:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Manifest) */
				errn = decode_dinManifestType(stream, &exiDoc->Manifest);
				exiDoc->Manifest_isUsed = 1u;
				break;
			case 37:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeteringReceiptReq) */
				errn = decode_dinMeteringReceiptReqType(stream, &exiDoc->MeteringReceiptReq);
				exiDoc->MeteringReceiptReq_isUsed = 1u;
				break;
			case 38:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeteringReceiptRes) */
				errn = decode_dinMeteringReceiptResType(stream, &exiDoc->MeteringReceiptRes);
				exiDoc->MeteringReceiptRes_isUsed = 1u;
				break;
			case 39:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData) */
				/* First(xsi:type)StartTag[CHARACTERS[STRING]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeUnsignedInteger16(stream, &exiDoc->MgmtData.charactersLen);
						if (errn == 0) {
							if (exiDoc->MgmtData.charactersLen >= 2) {
								exiDoc->MgmtData.charactersLen = (uint16_t)(exiDoc->MgmtData.charactersLen - 2); /* string table miss */
								errn = decodeCharacters(stream, exiDoc->MgmtData.charactersLen, exiDoc->MgmtData.characters, dinEXIDocument_MgmtData_CHARACTERS_SIZE);
							} else {
								/* string table hit */
								errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
							}
						}
						exiDoc->MgmtData_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 40:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Object) */
				errn = decode_dinObjectType(stream, &exiDoc->Object);
				exiDoc->Object_isUsed = 1u;
				break;
			case 41:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData) */
				errn = decode_dinPGPDataType(stream, &exiDoc->PGPData);
				exiDoc->PGPData_isUsed = 1u;
				break;
			case 42:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMaxScheduleEntry) */
				errn = decode_dinPMaxScheduleEntryType(stream, &exiDoc->PMaxScheduleEntry);
				exiDoc->PMaxScheduleEntry_isUsed = 1u;
				break;
			case 43:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PaymentDetailsReq) */
				errn = decode_dinPaymentDetailsReqType(stream, &exiDoc->PaymentDetailsReq);
				exiDoc->PaymentDetailsReq_isUsed = 1u;
				break;
			case 44:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PaymentDetailsRes) */
				errn = decode_dinPaymentDetailsResType(stream, &exiDoc->PaymentDetailsRes);
				exiDoc->PaymentDetailsRes_isUsed = 1u;
				break;
			case 45:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PowerDeliveryReq) */
				errn = decode_dinPowerDeliveryReqType(stream, &exiDoc->PowerDeliveryReq);
				exiDoc->PowerDeliveryReq_isUsed = 1u;
				break;
			case 46:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PowerDeliveryRes) */
				errn = decode_dinPowerDeliveryResType(stream, &exiDoc->PowerDeliveryRes);
				exiDoc->PowerDeliveryRes_isUsed = 1u;
				break;
			case 47:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PreChargeReq) */
				errn = decode_dinPreChargeReqType(stream, &exiDoc->PreChargeReq);
				exiDoc->PreChargeReq_isUsed = 1u;
				break;
			case 48:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PreChargeRes) */
				errn = decode_dinPreChargeResType(stream, &exiDoc->PreChargeRes);
				exiDoc->PreChargeRes_isUsed = 1u;
				break;
			case 49:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RSAKeyValue) */
				errn = decode_dinRSAKeyValueType(stream, &exiDoc->RSAKeyValue);
				exiDoc->RSAKeyValue_isUsed = 1u;
				break;
			case 50:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference) */
				errn = decode_dinReferenceType(stream, &exiDoc->Reference);
				exiDoc->Reference_isUsed = 1u;
				break;
			case 51:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RelativeTimeInterval) */
				errn = decode_dinRelativeTimeIntervalType(stream, &exiDoc->RelativeTimeInterval);
				exiDoc->RelativeTimeInterval_isUsed = 1u;
				break;
			case 52:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod) */
				errn = decode_dinRetrievalMethodType(stream, &exiDoc->RetrievalMethod);
				exiDoc->RetrievalMethod_isUsed = 1u;
				break;
			case 53:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleList) */
				errn = decode_dinSAScheduleListType(stream, &exiDoc->SAScheduleList);
				exiDoc->SAScheduleList_isUsed = 1u;
				break;
			case 54:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SASchedules) */
				errn = decode_dinSASchedulesType(stream, &exiDoc->SASchedules);
				exiDoc->SASchedules_isUsed = 1u;
				break;
			case 55:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData) */
				errn = decode_dinSPKIDataType(stream, &exiDoc->SPKIData);
				exiDoc->SPKIData_isUsed = 1u;
				break;
			case 56:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffEntry) */
				errn = decode_dinSalesTariffEntryType(stream, &exiDoc->SalesTariffEntry);
				exiDoc->SalesTariffEntry_isUsed = 1u;
				break;
			case 57:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceCharge) */
				errn = decode_dinServiceChargeType(stream, &exiDoc->ServiceCharge);
				exiDoc->ServiceCharge_isUsed = 1u;
				break;
			case 58:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDetailReq) */
				errn = decode_dinServiceDetailReqType(stream, &exiDoc->ServiceDetailReq);
				exiDoc->ServiceDetailReq_isUsed = 1u;
				break;
			case 59:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDetailRes) */
				errn = decode_dinServiceDetailResType(stream, &exiDoc->ServiceDetailRes);
				exiDoc->ServiceDetailRes_isUsed = 1u;
				break;
			case 60:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDiscoveryReq) */
				errn = decode_dinServiceDiscoveryReqType(stream, &exiDoc->ServiceDiscoveryReq);
				exiDoc->ServiceDiscoveryReq_isUsed = 1u;
				break;
			case 61:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDiscoveryRes) */
				errn = decode_dinServiceDiscoveryResType(stream, &exiDoc->ServiceDiscoveryRes);
				exiDoc->ServiceDiscoveryRes_isUsed = 1u;
				break;
			case 62:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServicePaymentSelectionReq) */
				errn = decode_dinServicePaymentSelectionReqType(stream, &exiDoc->ServicePaymentSelectionReq);
				exiDoc->ServicePaymentSelectionReq_isUsed = 1u;
				break;
			case 63:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServicePaymentSelectionRes) */
				errn = decode_dinServicePaymentSelectionResType(stream, &exiDoc->ServicePaymentSelectionRes);
				exiDoc->ServicePaymentSelectionRes_isUsed = 1u;
				break;
			case 64:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionSetupReq) */
				errn = decode_dinSessionSetupReqType(stream, &exiDoc->SessionSetupReq);
				exiDoc->SessionSetupReq_isUsed = 1u;
				break;
			case 65:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionSetupRes) */
				errn = decode_dinSessionSetupResType(stream, &exiDoc->SessionSetupRes);
				exiDoc->SessionSetupRes_isUsed = 1u;
				break;
			case 66:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionStopReq) */
				errn = decode_dinSessionStopType(stream, &exiDoc->SessionStopReq);
				exiDoc->SessionStopReq_isUsed = 1u;
				break;
			case 67:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionStopRes) */
				errn = decode_dinSessionStopResType(stream, &exiDoc->SessionStopRes);
				exiDoc->SessionStopRes_isUsed = 1u;
				break;
			case 68:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Signature) */
				errn = decode_dinSignatureType(stream, &exiDoc->Signature);
				exiDoc->Signature_isUsed = 1u;
				break;
			case 69:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureMethod) */
				errn = decode_dinSignatureMethodType(stream, &exiDoc->SignatureMethod);
				exiDoc->SignatureMethod_isUsed = 1u;
				break;
			case 70:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperties) */
				errn = decode_dinSignaturePropertiesType(stream, &exiDoc->SignatureProperties);
				exiDoc->SignatureProperties_isUsed = 1u;
				break;
			case 71:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty) */
				errn = decode_dinSignaturePropertyType(stream, &exiDoc->SignatureProperty);
				exiDoc->SignatureProperty_isUsed = 1u;
				break;
			case 72:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureValue) */
				errn = decode_dinSignatureValueType(stream, &exiDoc->SignatureValue);
				exiDoc->SignatureValue_isUsed = 1u;
				break;
			case 73:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignedInfo) */
				errn = decode_dinSignedInfoType(stream, &exiDoc->SignedInfo);
				exiDoc->SignedInfo_isUsed = 1u;
				break;
			case 74:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TimeInterval) */
				errn = decode_dinIntervalType(stream, &exiDoc->TimeInterval);
				exiDoc->TimeInterval_isUsed = 1u;
				break;
			case 75:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform) */
				errn = decode_dinTransformType(stream, &exiDoc->Transform);
				exiDoc->Transform_isUsed = 1u;
				break;
			case 76:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms) */
				errn = decode_dinTransformsType(stream, &exiDoc->Transforms);
				exiDoc->Transforms_isUsed = 1u;
				break;
			case 77:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDef}V2G_Message) */
				errn = decode_dinAnonType_V2G_Message(stream, &exiDoc->V2G_Message);
				exiDoc->V2G_Message_isUsed = 1u;
				break;
			case 78:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}WeldingDetectionReq) */
				errn = decode_dinWeldingDetectionReqType(stream, &exiDoc->WeldingDetectionReq);
				exiDoc->WeldingDetectionReq_isUsed = 1u;
				break;
			case 79:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}WeldingDetectionRes) */
				errn = decode_dinWeldingDetectionResType(stream, &exiDoc->WeldingDetectionRes);
				exiDoc->WeldingDetectionRes_isUsed = 1u;
				break;
			case 80:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data) */
				errn = decode_dinX509DataType(stream, &exiDoc->X509Data);
				exiDoc->X509Data_isUsed = 1u;
				break;
			default:
				errn = EXI_ERROR_UNEXPECTED_EVENT_LEVEL1;
				break;
			}
		}

	}

	(void)exiDoc; /* avoid unused warning */
	(void)eventCode; /* avoid unused warning */
	(void)uint32; /* avoid unused warning */

	return errn;
}

#if DEPLOY_DIN_CODEC_FRAGMENT == SUPPORT_YES
int decode_dinExiFragment(bitstream_t* stream, struct dinEXIFragment* exiFrag) {
	errn = readEXIHeader(stream);

	if(errn == 0) {
		/* FragmentContent[START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}AC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDef}Body), START_ELEMENT({urn:iso:15118:2:2010:MsgDef}BodyElement), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkChargingComplete), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkSOC), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CableCheckReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CableCheckRes), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Certificate), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateInstallationReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateInstallationRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateUpdateReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateUpdateRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargeParameterDiscoveryReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargeParameterDiscoveryRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargeService), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingComplete), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingProfile), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingProfileEntryMaxPower), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingProfileEntryStart), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingStatusReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingStatusRes), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ConsumptionCost), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractAuthenticationReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractAuthenticationRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractID), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureCertChain), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureEncryptedPrivateKey), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Cost), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CurrentDemandReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CurrentDemandRes), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVPowerDeliveryParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVSEStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DHParams), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DSAKeyValue), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DateTimeNow), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DepartureTime), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestValue), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EAmount), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EPriceLevel), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVCCID), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVCabinConditioning), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVEnergyCapacity), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVEnergyRequest), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVErrorCode), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaxCurrent), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaxVoltage), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumVoltageLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaximumVoltageLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMinCurrent), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVPowerDeliveryParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVRESSConditioning), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVRESSSOC), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVReady), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVRequestedEnergyTransferType), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEChargeParameter), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSECurrentLimitAchieved), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSECurrentRegulationTolerance), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEEnergyToBeDelivered), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEID), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEIsolationStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaxCurrent), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaxCurrent), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaxVoltage), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaximumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaximumPowerLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaximumVoltageLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaximumVoltageLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMinCurrent), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMinimumCurrentLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMinimumVoltageLimit), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSENotification), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEPeakCurrentRipple), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEPowerLimitAchieved), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEPresentCurrent), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEPresentVoltage), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEProcessing), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEStatusCode), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEVoltageLimitAchieved), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetCurrent), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetVoltage), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EnergyTransferType), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Entry), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Exponent), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FaultCode), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FaultMsg), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FreeService), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FullSOC), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}GenChallenge), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength), START_ELEMENT({urn:iso:15118:2:2010:MsgDef}Header), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}J), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyInfo), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ListOfRootCertificateIDs), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Manifest), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterID), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeterInfo), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterReading), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterStatus), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeteringReceiptReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeteringReceiptRes), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Modulus), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Multiplier), START_ELEMENT({urn:iso:15118:2:2010:MsgHeader}Notification), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}NotificationMaxDelay), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}NumEPriceLevels), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}OEMProvisioningCert), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Object), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}P), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyID), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMax), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMaxSchedule), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMaxScheduleEntry), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMaxScheduleID), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Parameter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ParameterSet), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ParameterSetID), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PaymentDetailsReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PaymentDetailsRes), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PaymentOption), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PaymentOptions), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PgenCounter), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PowerDeliveryReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PowerDeliveryRes), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PowerSwitchClosed), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PreChargeReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PreChargeRes), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ProfileEntry), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Q), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RCD), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RSAKeyValue), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReadyToChargeState), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReceiptRequired), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RelativeTimeInterval), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}RemainingTimeToBulkSoC), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}RemainingTimeToFullSoC), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}RetryCounter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RootCertificateID), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleList), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleTuple), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SAScheduleTupleID), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleTupleID), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SASchedules), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariff), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffDescription), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffEntry), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffID), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SelectedPaymentOption), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SelectedService), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SelectedServiceList), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Service), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceCategory), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceCategory), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceCharge), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDetailReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDetailRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDiscoveryReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDiscoveryRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceID), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceID), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceList), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceName), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceParameterList), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServicePaymentSelectionReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServicePaymentSelectionRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceScope), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceScope), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceTag), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionID), START_ELEMENT({urn:iso:15118:2:2010:MsgHeader}SessionID), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionSetupReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionSetupRes), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionStopReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionStopRes), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SigMeterReading), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Signature), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureMethod), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperties), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureValue), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignedInfo), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SubCertificates), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TMeter), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TimeInterval), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Unit), START_ELEMENT({urn:iso:15118:2:2010:MsgDef}V2G_Message), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Value), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}WeldingDetectionReq), START_ELEMENT({urn:iso:15118:2:2010:MsgBody}WeldingDetectionRes), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerSerial), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SerialNumber), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}XPath), START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}amount), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}amountMultiplier), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}boolValue), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}byteValue), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}costKind), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}duration), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}intValue), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}physicalValue), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}shortValue), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}start), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}startValue), START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}stringValue), START_ELEMENT_GENERIC, END_DOCUMENT] */
		init_dinEXIFragment(exiFrag);
		errn = decodeNBitUnsignedInteger(stream, 8, &eventCode);
		if(errn == 0) {
			switch(eventCode) {
			case 0:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVChargeParameter) */
				errn = decode_dinAC_EVChargeParameterType(stream, &exiFrag->AC_EVChargeParameter);
				exiFrag->AC_EVChargeParameter_isUsed = 1u;
				break;
			case 1:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVSEChargeParameter) */
				errn = decode_dinAC_EVSEChargeParameterType(stream, &exiFrag->AC_EVSEChargeParameter);
				exiFrag->AC_EVSEChargeParameter_isUsed = 1u;
				break;
			case 2:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}AC_EVSEStatus) */
				errn = decode_dinAC_EVSEStatusType(stream, &exiFrag->AC_EVSEStatus);
				exiFrag->AC_EVSEStatus_isUsed = 1u;
				break;
			case 3:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}AC_EVSEStatus) */
				errn = decode_dinAC_EVSEStatusType(stream, &exiFrag->AC_EVSEStatus);
				exiFrag->AC_EVSEStatus_isUsed = 1u;
				break;
			case 4:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDef}Body) */
				errn = decode_dinBodyType(stream, &exiFrag->Body);
				exiFrag->Body_isUsed = 1u;
				break;
			case 5:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDef}BodyElement) */
				errn = decode_dinBodyBaseType(stream, &exiFrag->BodyElement);
				exiFrag->BodyElement_isUsed = 1u;
				break;
			case 6:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}BulkChargingComplete) */
				/* FirstStartTag[CHARACTERS[BOOLEAN]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeBoolean(stream, &exiFrag->BulkChargingComplete);
						exiFrag->BulkChargingComplete_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 7:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkChargingComplete) */
				/* FirstStartTag[CHARACTERS[BOOLEAN]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeBoolean(stream, &exiFrag->BulkChargingComplete);
						exiFrag->BulkChargingComplete_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 8:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}BulkSOC) */
				/* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeNBitUnsignedInteger(stream, 7, &(uint32));
						exiFrag->BulkSOC = (int8_t)(uint32 + 0);
						exiFrag->BulkSOC_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 9:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CableCheckReq) */
				errn = decode_dinCableCheckReqType(stream, &exiFrag->CableCheckReq);
				exiFrag->CableCheckReq_isUsed = 1u;
				break;
			case 10:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CableCheckRes) */
				errn = decode_dinCableCheckResType(stream, &exiFrag->CableCheckRes);
				exiFrag->CableCheckRes_isUsed = 1u;
				break;
			case 11:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}CanonicalizationMethod) */
				errn = decode_dinCanonicalizationMethodType(stream, &exiFrag->CanonicalizationMethod);
				exiFrag->CanonicalizationMethod_isUsed = 1u;
				break;
			case 12:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Certificate) */
				/* FirstStartTag[CHARACTERS[BINARY_BASE64]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeUnsignedInteger16(stream, &exiFrag->Certificate.bytesLen);
						if (errn == 0) {
							errn =  (exiFrag->Certificate.bytesLen) <= dinEXIFragment_Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
						}
						if (errn == 0) {
							errn = decodeBytes(stream, exiFrag->Certificate.bytesLen, exiFrag->Certificate.bytes);
						}
						exiFrag->Certificate_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 13:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateInstallationReq) */
				errn = decode_dinCertificateInstallationReqType(stream, &exiFrag->CertificateInstallationReq);
				exiFrag->CertificateInstallationReq_isUsed = 1u;
				break;
			case 14:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateInstallationRes) */
				errn = decode_dinCertificateInstallationResType(stream, &exiFrag->CertificateInstallationRes);
				exiFrag->CertificateInstallationRes_isUsed = 1u;
				break;
			case 15:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateUpdateReq) */
				errn = decode_dinCertificateUpdateReqType(stream, &exiFrag->CertificateUpdateReq);
				exiFrag->CertificateUpdateReq_isUsed = 1u;
				break;
			case 16:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CertificateUpdateRes) */
				errn = decode_dinCertificateUpdateResType(stream, &exiFrag->CertificateUpdateRes);
				exiFrag->CertificateUpdateRes_isUsed = 1u;
				break;
			case 17:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargeParameterDiscoveryReq) */
				errn = decode_dinChargeParameterDiscoveryReqType(stream, &exiFrag->ChargeParameterDiscoveryReq);
				exiFrag->ChargeParameterDiscoveryReq_isUsed = 1u;
				break;
			case 18:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargeParameterDiscoveryRes) */
				errn = decode_dinChargeParameterDiscoveryResType(stream, &exiFrag->ChargeParameterDiscoveryRes);
				exiFrag->ChargeParameterDiscoveryRes_isUsed = 1u;
				break;
			case 19:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargeService) */
				errn = decode_dinServiceChargeType(stream, &exiFrag->ChargeService);
				exiFrag->ChargeService_isUsed = 1u;
				break;
			case 20:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingComplete) */
				/* FirstStartTag[CHARACTERS[BOOLEAN]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeBoolean(stream, &exiFrag->ChargingComplete);
						exiFrag->ChargingComplete_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 21:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingComplete) */
				/* FirstStartTag[CHARACTERS[BOOLEAN]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeBoolean(stream, &exiFrag->ChargingComplete);
						exiFrag->ChargingComplete_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 22:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingProfile) */
				errn = decode_dinChargingProfileType(stream, &exiFrag->ChargingProfile);
				exiFrag->ChargingProfile_isUsed = 1u;
				break;
			case 23:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingProfileEntryMaxPower) */
				/* FirstStartTag[CHARACTERS[INTEGER]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeInteger16(stream, &exiFrag->ChargingProfileEntryMaxPower);
						exiFrag->ChargingProfileEntryMaxPower_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 24:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ChargingProfileEntryStart) */
				/* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeUnsignedInteger32(stream, &exiFrag->ChargingProfileEntryStart);
						exiFrag->ChargingProfileEntryStart_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 25:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingStatusReq) */
				errn = decode_dinChargingStatusReqType(stream, &exiFrag->ChargingStatusReq);
				exiFrag->ChargingStatusReq_isUsed = 1u;
				break;
			case 26:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ChargingStatusRes) */
				errn = decode_dinChargingStatusResType(stream, &exiFrag->ChargingStatusRes);
				exiFrag->ChargingStatusRes_isUsed = 1u;
				break;
			case 27:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ConsumptionCost) */
				errn = decode_dinConsumptionCostType(stream, &exiFrag->ConsumptionCost);
				exiFrag->ConsumptionCost_isUsed = 1u;
				break;
			case 28:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractAuthenticationReq) */
				errn = decode_dinContractAuthenticationReqType(stream, &exiFrag->ContractAuthenticationReq);
				exiFrag->ContractAuthenticationReq_isUsed = 1u;
				break;
			case 29:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractAuthenticationRes) */
				errn = decode_dinContractAuthenticationResType(stream, &exiFrag->ContractAuthenticationRes);
				exiFrag->ContractAuthenticationRes_isUsed = 1u;
				break;
			case 30:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractID) */
				/* FirstStartTag[CHARACTERS[STRING]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeUnsignedInteger16(stream, &exiFrag->ContractID.charactersLen);
						if (errn == 0) {
							if (exiFrag->ContractID.charactersLen >= 2) {
								exiFrag->ContractID.charactersLen = (uint16_t)(exiFrag->ContractID.charactersLen - 2); /* string table miss */
								errn = decodeCharacters(stream, exiFrag->ContractID.charactersLen, exiFrag->ContractID.characters, dinEXIFragment_ContractID_CHARACTERS_SIZE);
							} else {
								/* string table hit */
								errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
							}
						}
						exiFrag->ContractID_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 31:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureCertChain) */
				errn = decode_dinCertificateChainType(stream, &exiFrag->ContractSignatureCertChain);
				exiFrag->ContractSignatureCertChain_isUsed = 1u;
				break;
			case 32:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ContractSignatureEncryptedPrivateKey) */
				/* FirstStartTag[CHARACTERS[BINARY_BASE64]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeUnsignedInteger16(stream, &exiFrag->ContractSignatureEncryptedPrivateKey.bytesLen);
						if (errn == 0) {
							errn =  (exiFrag->ContractSignatureEncryptedPrivateKey.bytesLen) <= dinEXIFragment_ContractSignatureEncryptedPrivateKey_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
						}
						if (errn == 0) {
							errn = decodeBytes(stream, exiFrag->ContractSignatureEncryptedPrivateKey.bytesLen, exiFrag->ContractSignatureEncryptedPrivateKey.bytes);
						}
						exiFrag->ContractSignatureEncryptedPrivateKey_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 33:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Cost) */
				errn = decode_dinCostType(stream, &exiFrag->Cost);
				exiFrag->Cost_isUsed = 1u;
				break;
			case 34:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CurrentDemandReq) */
				errn = decode_dinCurrentDemandReqType(stream, &exiFrag->CurrentDemandReq);
				exiFrag->CurrentDemandReq_isUsed = 1u;
				break;
			case 35:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}CurrentDemandRes) */
				errn = decode_dinCurrentDemandResType(stream, &exiFrag->CurrentDemandRes);
				exiFrag->CurrentDemandRes_isUsed = 1u;
				break;
			case 36:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVChargeParameter) */
				errn = decode_dinDC_EVChargeParameterType(stream, &exiFrag->DC_EVChargeParameter);
				exiFrag->DC_EVChargeParameter_isUsed = 1u;
				break;
			case 37:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVPowerDeliveryParameter) */
				errn = decode_dinDC_EVPowerDeliveryParameterType(stream, &exiFrag->DC_EVPowerDeliveryParameter);
				exiFrag->DC_EVPowerDeliveryParameter_isUsed = 1u;
				break;
			case 38:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVSEChargeParameter) */
				errn = decode_dinDC_EVSEChargeParameterType(stream, &exiFrag->DC_EVSEChargeParameter);
				exiFrag->DC_EVSEChargeParameter_isUsed = 1u;
				break;
			case 39:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVSEStatus) */
				errn = decode_dinDC_EVSEStatusType(stream, &exiFrag->DC_EVSEStatus);
				exiFrag->DC_EVSEStatus_isUsed = 1u;
				break;
			case 40:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVSEStatus) */
				errn = decode_dinDC_EVSEStatusType(stream, &exiFrag->DC_EVSEStatus);
				exiFrag->DC_EVSEStatus_isUsed = 1u;
				break;
			case 41:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DC_EVStatus) */
				errn = decode_dinDC_EVStatusType(stream, &exiFrag->DC_EVStatus);
				exiFrag->DC_EVStatus_isUsed = 1u;
				break;
			case 42:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DC_EVStatus) */
				errn = decode_dinDC_EVStatusType(stream, &exiFrag->DC_EVStatus);
				exiFrag->DC_EVStatus_isUsed = 1u;
				break;
			case 43:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DHParams) */
				/* FirstStartTag[CHARACTERS[BINARY_BASE64]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeUnsignedInteger16(stream, &exiFrag->DHParams.bytesLen);
						if (errn == 0) {
							errn =  (exiFrag->DHParams.bytesLen) <= dinEXIFragment_DHParams_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
						}
						if (errn == 0) {
							errn = decodeBytes(stream, exiFrag->DHParams.bytesLen, exiFrag->DHParams.bytes);
						}
						exiFrag->DHParams_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 44:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DSAKeyValue) */
				errn = decode_dinDSAKeyValueType(stream, &exiFrag->DSAKeyValue);
				exiFrag->DSAKeyValue_isUsed = 1u;
				break;
			case 45:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}DateTimeNow) */
				/* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeInteger64(stream, &exiFrag->DateTimeNow);
						exiFrag->DateTimeNow_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 46:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}DepartureTime) */
				/* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeUnsignedInteger32(stream, &exiFrag->DepartureTime);
						exiFrag->DepartureTime_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 47:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestMethod) */
				errn = decode_dinDigestMethodType(stream, &exiFrag->DigestMethod);
				exiFrag->DigestMethod_isUsed = 1u;
				break;
			case 48:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}DigestValue) */
				/* FirstStartTag[CHARACTERS[BINARY_BASE64]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeUnsignedInteger16(stream, &exiFrag->DigestValue.bytesLen);
						if (errn == 0) {
							errn =  (exiFrag->DigestValue.bytesLen) <= dinEXIFragment_DigestValue_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
						}
						if (errn == 0) {
							errn = decodeBytes(stream, exiFrag->DigestValue.bytesLen, exiFrag->DigestValue.bytes);
						}
						exiFrag->DigestValue_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 49:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EAmount) */
				errn = decode_dinPhysicalValueType(stream, &exiFrag->EAmount);
				exiFrag->EAmount_isUsed = 1u;
				break;
			case 50:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EPriceLevel) */
				/* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeNBitUnsignedInteger(stream, 8, &(uint32));
						exiFrag->EPriceLevel = (uint8_t)(uint32 + 0);
						exiFrag->EPriceLevel_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 51:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVCCID) */
				/* FirstStartTag[CHARACTERS[BINARY_HEX]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeUnsignedInteger16(stream, &exiFrag->EVCCID.bytesLen);
						if (errn == 0) {
							errn =  (exiFrag->EVCCID.bytesLen) <= dinEXIFragment_EVCCID_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
						}
						if (errn == 0) {
							errn = decodeBytes(stream, exiFrag->EVCCID.bytesLen, exiFrag->EVCCID.bytes);
						}
						exiFrag->EVCCID_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 52:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVCabinConditioning) */
				/* FirstStartTag[CHARACTERS[BOOLEAN]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeBoolean(stream, &exiFrag->EVCabinConditioning);
						exiFrag->EVCabinConditioning_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 53:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVChargeParameter) */
				errn = decode_dinEVChargeParameterType(stream, &exiFrag->EVChargeParameter);
				exiFrag->EVChargeParameter_isUsed = 1u;
				break;
			case 54:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVEnergyCapacity) */
				errn = decode_dinPhysicalValueType(stream, &exiFrag->EVEnergyCapacity);
				exiFrag->EVEnergyCapacity_isUsed = 1u;
				break;
			case 55:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVEnergyRequest) */
				errn = decode_dinPhysicalValueType(stream, &exiFrag->EVEnergyRequest);
				exiFrag->EVEnergyRequest_isUsed = 1u;
				break;
			case 56:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVErrorCode) */
				/* FirstStartTag[CHARACTERS[ENUMERATION]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeNBitUnsignedInteger(stream, 4, &uint32);
						exiFrag->EVErrorCode = (dinDC_EVErrorCodeType) uint32;
						exiFrag->EVErrorCode_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 57:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaxCurrent) */
				errn = decode_dinPhysicalValueType(stream, &exiFrag->EVMaxCurrent);
				exiFrag->EVMaxCurrent_isUsed = 1u;
				break;
			case 58:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaxVoltage) */
				errn = decode_dinPhysicalValueType(stream, &exiFrag->EVMaxVoltage);
				exiFrag->EVMaxVoltage_isUsed = 1u;
				break;
			case 59:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumCurrentLimit) */
				errn = decode_dinPhysicalValueType(stream, &exiFrag->EVMaximumCurrentLimit);
				exiFrag->EVMaximumCurrentLimit_isUsed = 1u;
				break;
			case 60:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaximumCurrentLimit) */
				errn = decode_dinPhysicalValueType(stream, &exiFrag->EVMaximumCurrentLimit);
				exiFrag->EVMaximumCurrentLimit_isUsed = 1u;
				break;
			case 61:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumPowerLimit) */
				errn = decode_dinPhysicalValueType(stream, &exiFrag->EVMaximumPowerLimit);
				exiFrag->EVMaximumPowerLimit_isUsed = 1u;
				break;
			case 62:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaximumPowerLimit) */
				errn = decode_dinPhysicalValueType(stream, &exiFrag->EVMaximumPowerLimit);
				exiFrag->EVMaximumPowerLimit_isUsed = 1u;
				break;
			case 63:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVMaximumVoltageLimit) */
				errn = decode_dinPhysicalValueType(stream, &exiFrag->EVMaximumVoltageLimit);
				exiFrag->EVMaximumVoltageLimit_isUsed = 1u;
				break;
			case 64:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMaximumVoltageLimit) */
				errn = decode_dinPhysicalValueType(stream, &exiFrag->EVMaximumVoltageLimit);
				exiFrag->EVMaximumVoltageLimit_isUsed = 1u;
				break;
			case 65:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVMinCurrent) */
				errn = decode_dinPhysicalValueType(stream, &exiFrag->EVMinCurrent);
				exiFrag->EVMinCurrent_isUsed = 1u;
				break;
			case 66:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVPowerDeliveryParameter) */
				errn = decode_dinEVPowerDeliveryParameterType(stream, &exiFrag->EVPowerDeliveryParameter);
				exiFrag->EVPowerDeliveryParameter_isUsed = 1u;
				break;
			case 67:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVRESSConditioning) */
				/* FirstStartTag[CHARACTERS[BOOLEAN]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeBoolean(stream, &exiFrag->EVRESSConditioning);
						exiFrag->EVRESSConditioning_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 68:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVRESSSOC) */
				/* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeNBitUnsignedInteger(stream, 7, &(uint32));
						exiFrag->EVRESSSOC = (int8_t)(uint32 + 0);
						exiFrag->EVRESSSOC_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 69:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVReady) */
				/* FirstStartTag[CHARACTERS[BOOLEAN]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeBoolean(stream, &exiFrag->EVReady);
						exiFrag->EVReady_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 70:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVRequestedEnergyTransferType) */
				/* FirstStartTag[CHARACTERS[ENUMERATION]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeNBitUnsignedInteger(stream, 3, &uint32);
						exiFrag->EVRequestedEnergyTransferType = (dinEVRequestedEnergyTransferType) uint32;
						exiFrag->EVRequestedEnergyTransferType_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 71:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEChargeParameter) */
				errn = decode_dinEVSEChargeParameterType(stream, &exiFrag->EVSEChargeParameter);
				exiFrag->EVSEChargeParameter_isUsed = 1u;
				break;
			case 72:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSECurrentLimitAchieved) */
				/* FirstStartTag[CHARACTERS[BOOLEAN]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeBoolean(stream, &exiFrag->EVSECurrentLimitAchieved);
						exiFrag->EVSECurrentLimitAchieved_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 73:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSECurrentRegulationTolerance) */
				errn = decode_dinPhysicalValueType(stream, &exiFrag->EVSECurrentRegulationTolerance);
				exiFrag->EVSECurrentRegulationTolerance_isUsed = 1u;
				break;
			case 74:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEEnergyToBeDelivered) */
				errn = decode_dinPhysicalValueType(stream, &exiFrag->EVSEEnergyToBeDelivered);
				exiFrag->EVSEEnergyToBeDelivered_isUsed = 1u;
				break;
			case 75:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEID) */
				/* FirstStartTag[CHARACTERS[BINARY_HEX]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeUnsignedInteger16(stream, &exiFrag->EVSEID.bytesLen);
						if (errn == 0) {
							errn =  (exiFrag->EVSEID.bytesLen) <= dinEXIFragment_EVSEID_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
						}
						if (errn == 0) {
							errn = decodeBytes(stream, exiFrag->EVSEID.bytesLen, exiFrag->EVSEID.bytes);
						}
						exiFrag->EVSEID_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 76:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEIsolationStatus) */
				/* FirstStartTag[CHARACTERS[ENUMERATION]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeNBitUnsignedInteger(stream, 2, &uint32);
						exiFrag->EVSEIsolationStatus = (dinisolationLevelType) uint32;
						exiFrag->EVSEIsolationStatus_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 77:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaxCurrent) */
				errn = decode_dinPhysicalValueType(stream, &exiFrag->EVSEMaxCurrent);
				exiFrag->EVSEMaxCurrent_isUsed = 1u;
				break;
			case 78:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaxCurrent) */
				errn = decode_dinPhysicalValueType(stream, &exiFrag->EVSEMaxCurrent);
				exiFrag->EVSEMaxCurrent_isUsed = 1u;
				break;
			case 79:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaxVoltage) */
				errn = decode_dinPhysicalValueType(stream, &exiFrag->EVSEMaxVoltage);
				exiFrag->EVSEMaxVoltage_isUsed = 1u;
				break;
			case 80:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaximumCurrentLimit) */
				errn = decode_dinPhysicalValueType(stream, &exiFrag->EVSEMaximumCurrentLimit);
				exiFrag->EVSEMaximumCurrentLimit_isUsed = 1u;
				break;
			case 81:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaximumCurrentLimit) */
				errn = decode_dinPhysicalValueType(stream, &exiFrag->EVSEMaximumCurrentLimit);
				exiFrag->EVSEMaximumCurrentLimit_isUsed = 1u;
				break;
			case 82:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaximumPowerLimit) */
				errn = decode_dinPhysicalValueType(stream, &exiFrag->EVSEMaximumPowerLimit);
				exiFrag->EVSEMaximumPowerLimit_isUsed = 1u;
				break;
			case 83:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaximumPowerLimit) */
				errn = decode_dinPhysicalValueType(stream, &exiFrag->EVSEMaximumPowerLimit);
				exiFrag->EVSEMaximumPowerLimit_isUsed = 1u;
				break;
			case 84:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEMaximumVoltageLimit) */
				errn = decode_dinPhysicalValueType(stream, &exiFrag->EVSEMaximumVoltageLimit);
				exiFrag->EVSEMaximumVoltageLimit_isUsed = 1u;
				break;
			case 85:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMaximumVoltageLimit) */
				errn = decode_dinPhysicalValueType(stream, &exiFrag->EVSEMaximumVoltageLimit);
				exiFrag->EVSEMaximumVoltageLimit_isUsed = 1u;
				break;
			case 86:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMinCurrent) */
				errn = decode_dinPhysicalValueType(stream, &exiFrag->EVSEMinCurrent);
				exiFrag->EVSEMinCurrent_isUsed = 1u;
				break;
			case 87:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMinimumCurrentLimit) */
				errn = decode_dinPhysicalValueType(stream, &exiFrag->EVSEMinimumCurrentLimit);
				exiFrag->EVSEMinimumCurrentLimit_isUsed = 1u;
				break;
			case 88:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEMinimumVoltageLimit) */
				errn = decode_dinPhysicalValueType(stream, &exiFrag->EVSEMinimumVoltageLimit);
				exiFrag->EVSEMinimumVoltageLimit_isUsed = 1u;
				break;
			case 89:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSENotification) */
				/* FirstStartTag[CHARACTERS[ENUMERATION]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeNBitUnsignedInteger(stream, 2, &uint32);
						exiFrag->EVSENotification = (dinEVSENotificationType) uint32;
						exiFrag->EVSENotification_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 90:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEPeakCurrentRipple) */
				errn = decode_dinPhysicalValueType(stream, &exiFrag->EVSEPeakCurrentRipple);
				exiFrag->EVSEPeakCurrentRipple_isUsed = 1u;
				break;
			case 91:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEPowerLimitAchieved) */
				/* FirstStartTag[CHARACTERS[BOOLEAN]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeBoolean(stream, &exiFrag->EVSEPowerLimitAchieved);
						exiFrag->EVSEPowerLimitAchieved_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 92:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEPresentCurrent) */
				errn = decode_dinPhysicalValueType(stream, &exiFrag->EVSEPresentCurrent);
				exiFrag->EVSEPresentCurrent_isUsed = 1u;
				break;
			case 93:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEPresentVoltage) */
				errn = decode_dinPhysicalValueType(stream, &exiFrag->EVSEPresentVoltage);
				exiFrag->EVSEPresentVoltage_isUsed = 1u;
				break;
			case 94:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEProcessing) */
				/* FirstStartTag[CHARACTERS[ENUMERATION]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeNBitUnsignedInteger(stream, 1, &uint32);
						exiFrag->EVSEProcessing = (dinEVSEProcessingType) uint32;
						exiFrag->EVSEProcessing_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 95:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEStatus) */
				errn = decode_dinEVSEStatusType(stream, &exiFrag->EVSEStatus);
				exiFrag->EVSEStatus_isUsed = 1u;
				break;
			case 96:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVSEStatusCode) */
				/* FirstStartTag[CHARACTERS[ENUMERATION]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeNBitUnsignedInteger(stream, 4, &uint32);
						exiFrag->EVSEStatusCode = (dinDC_EVSEStatusCodeType) uint32;
						exiFrag->EVSEStatusCode_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 97:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVSEVoltageLimitAchieved) */
				/* FirstStartTag[CHARACTERS[BOOLEAN]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeBoolean(stream, &exiFrag->EVSEVoltageLimitAchieved);
						exiFrag->EVSEVoltageLimitAchieved_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 98:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EVStatus) */
				errn = decode_dinEVStatusType(stream, &exiFrag->EVStatus);
				exiFrag->EVStatus_isUsed = 1u;
				break;
			case 99:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetCurrent) */
				errn = decode_dinPhysicalValueType(stream, &exiFrag->EVTargetCurrent);
				exiFrag->EVTargetCurrent_isUsed = 1u;
				break;
			case 100:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}EVTargetVoltage) */
				errn = decode_dinPhysicalValueType(stream, &exiFrag->EVTargetVoltage);
				exiFrag->EVTargetVoltage_isUsed = 1u;
				break;
			case 101:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}EnergyTransferType) */
				/* FirstStartTag[CHARACTERS[ENUMERATION]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeNBitUnsignedInteger(stream, 4, &uint32);
						exiFrag->EnergyTransferType = (dinEVSESupportedEnergyTransferType) uint32;
						exiFrag->EnergyTransferType_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 102:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Entry) */
				errn = decode_dinEntryType(stream, &exiFrag->Entry);
				exiFrag->Entry_isUsed = 1u;
				break;
			case 103:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Exponent) */
				/* FirstStartTag[CHARACTERS[BINARY_BASE64]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeUnsignedInteger16(stream, &exiFrag->Exponent.bytesLen);
						if (errn == 0) {
							errn =  (exiFrag->Exponent.bytesLen) <= dinEXIFragment_Exponent_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
						}
						if (errn == 0) {
							errn = decodeBytes(stream, exiFrag->Exponent.bytesLen, exiFrag->Exponent.bytes);
						}
						exiFrag->Exponent_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 104:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FaultCode) */
				/* FirstStartTag[CHARACTERS[ENUMERATION]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeNBitUnsignedInteger(stream, 2, &uint32);
						exiFrag->FaultCode = (dinfaultCodeType) uint32;
						exiFrag->FaultCode_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 105:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FaultMsg) */
				/* FirstStartTag[CHARACTERS[STRING]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeUnsignedInteger16(stream, &exiFrag->FaultMsg.charactersLen);
						if (errn == 0) {
							if (exiFrag->FaultMsg.charactersLen >= 2) {
								exiFrag->FaultMsg.charactersLen = (uint16_t)(exiFrag->FaultMsg.charactersLen - 2); /* string table miss */
								errn = decodeCharacters(stream, exiFrag->FaultMsg.charactersLen, exiFrag->FaultMsg.characters, dinEXIFragment_FaultMsg_CHARACTERS_SIZE);
							} else {
								/* string table hit */
								errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
							}
						}
						exiFrag->FaultMsg_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 106:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FreeService) */
				/* FirstStartTag[CHARACTERS[BOOLEAN]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeBoolean(stream, &exiFrag->FreeService);
						exiFrag->FreeService_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 107:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}FullSOC) */
				/* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeNBitUnsignedInteger(stream, 7, &(uint32));
						exiFrag->FullSOC = (int8_t)(uint32 + 0);
						exiFrag->FullSOC_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 108:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}G) */
				/* FirstStartTag[CHARACTERS[BINARY_BASE64]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeUnsignedInteger16(stream, &exiFrag->G.bytesLen);
						if (errn == 0) {
							errn =  (exiFrag->G.bytesLen) <= dinEXIFragment_G_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
						}
						if (errn == 0) {
							errn = decodeBytes(stream, exiFrag->G.bytesLen, exiFrag->G.bytes);
						}
						exiFrag->G_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 109:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}GenChallenge) */
				/* FirstStartTag[CHARACTERS[STRING]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeUnsignedInteger16(stream, &exiFrag->GenChallenge.charactersLen);
						if (errn == 0) {
							if (exiFrag->GenChallenge.charactersLen >= 2) {
								exiFrag->GenChallenge.charactersLen = (uint16_t)(exiFrag->GenChallenge.charactersLen - 2); /* string table miss */
								errn = decodeCharacters(stream, exiFrag->GenChallenge.charactersLen, exiFrag->GenChallenge.characters, dinEXIFragment_GenChallenge_CHARACTERS_SIZE);
							} else {
								/* string table hit */
								errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
							}
						}
						exiFrag->GenChallenge_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 110:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}HMACOutputLength) */
				/* FirstStartTag[CHARACTERS[INTEGER]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeInteger64(stream, &exiFrag->HMACOutputLength);
						exiFrag->HMACOutputLength_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 111:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDef}Header) */
				errn = decode_dinMessageHeaderType(stream, &exiFrag->Header);
				exiFrag->Header_isUsed = 1u;
				break;
			case 112:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}J) */
				/* FirstStartTag[CHARACTERS[BINARY_BASE64]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeUnsignedInteger16(stream, &exiFrag->J.bytesLen);
						if (errn == 0) {
							errn =  (exiFrag->J.bytesLen) <= dinEXIFragment_J_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
						}
						if (errn == 0) {
							errn = decodeBytes(stream, exiFrag->J.bytesLen, exiFrag->J.bytes);
						}
						exiFrag->J_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 113:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyInfo) */
				errn = decode_dinKeyInfoType(stream, &exiFrag->KeyInfo);
				exiFrag->KeyInfo_isUsed = 1u;
				break;
			case 114:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyName) */
				/* First(xsi:type)StartTag[CHARACTERS[STRING]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeUnsignedInteger16(stream, &exiFrag->KeyName.charactersLen);
						if (errn == 0) {
							if (exiFrag->KeyName.charactersLen >= 2) {
								exiFrag->KeyName.charactersLen = (uint16_t)(exiFrag->KeyName.charactersLen - 2); /* string table miss */
								errn = decodeCharacters(stream, exiFrag->KeyName.charactersLen, exiFrag->KeyName.characters, dinEXIFragment_KeyName_CHARACTERS_SIZE);
							} else {
								/* string table hit */
								errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
							}
						}
						exiFrag->KeyName_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 115:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}KeyValue) */
				errn = decode_dinKeyValueType(stream, &exiFrag->KeyValue);
				exiFrag->KeyValue_isUsed = 1u;
				break;
			case 116:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ListOfRootCertificateIDs) */
				errn = decode_dinListOfRootCertificateIDsType(stream, &exiFrag->ListOfRootCertificateIDs);
				exiFrag->ListOfRootCertificateIDs_isUsed = 1u;
				break;
			case 117:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Manifest) */
				errn = decode_dinManifestType(stream, &exiFrag->Manifest);
				exiFrag->Manifest_isUsed = 1u;
				break;
			case 118:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterID) */
				/* FirstStartTag[CHARACTERS[STRING]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeUnsignedInteger16(stream, &exiFrag->MeterID.charactersLen);
						if (errn == 0) {
							if (exiFrag->MeterID.charactersLen >= 2) {
								exiFrag->MeterID.charactersLen = (uint16_t)(exiFrag->MeterID.charactersLen - 2); /* string table miss */
								errn = decodeCharacters(stream, exiFrag->MeterID.charactersLen, exiFrag->MeterID.characters, dinEXIFragment_MeterID_CHARACTERS_SIZE);
							} else {
								/* string table hit */
								errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
							}
						}
						exiFrag->MeterID_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 119:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeterInfo) */
				errn = decode_dinMeterInfoType(stream, &exiFrag->MeterInfo);
				exiFrag->MeterInfo_isUsed = 1u;
				break;
			case 120:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterReading) */
				errn = decode_dinPhysicalValueType(stream, &exiFrag->MeterReading);
				exiFrag->MeterReading_isUsed = 1u;
				break;
			case 121:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}MeterStatus) */
				/* FirstStartTag[CHARACTERS[INTEGER]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeInteger16(stream, &exiFrag->MeterStatus);
						exiFrag->MeterStatus_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 122:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeteringReceiptReq) */
				errn = decode_dinMeteringReceiptReqType(stream, &exiFrag->MeteringReceiptReq);
				exiFrag->MeteringReceiptReq_isUsed = 1u;
				break;
			case 123:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}MeteringReceiptRes) */
				errn = decode_dinMeteringReceiptResType(stream, &exiFrag->MeteringReceiptRes);
				exiFrag->MeteringReceiptRes_isUsed = 1u;
				break;
			case 124:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}MgmtData) */
				/* First(xsi:type)StartTag[CHARACTERS[STRING]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeUnsignedInteger16(stream, &exiFrag->MgmtData.charactersLen);
						if (errn == 0) {
							if (exiFrag->MgmtData.charactersLen >= 2) {
								exiFrag->MgmtData.charactersLen = (uint16_t)(exiFrag->MgmtData.charactersLen - 2); /* string table miss */
								errn = decodeCharacters(stream, exiFrag->MgmtData.charactersLen, exiFrag->MgmtData.characters, dinEXIFragment_MgmtData_CHARACTERS_SIZE);
							} else {
								/* string table hit */
								errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
							}
						}
						exiFrag->MgmtData_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 125:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Modulus) */
				/* FirstStartTag[CHARACTERS[BINARY_BASE64]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeUnsignedInteger16(stream, &exiFrag->Modulus.bytesLen);
						if (errn == 0) {
							errn =  (exiFrag->Modulus.bytesLen) <= dinEXIFragment_Modulus_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
						}
						if (errn == 0) {
							errn = decodeBytes(stream, exiFrag->Modulus.bytesLen, exiFrag->Modulus.bytes);
						}
						exiFrag->Modulus_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 126:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Multiplier) */
				/* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeNBitUnsignedInteger(stream, 3, &(uint32));
						exiFrag->Multiplier = (int8_t)(uint32 -3);
						exiFrag->Multiplier_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 127:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgHeader}Notification) */
				errn = decode_dinNotificationType(stream, &exiFrag->Notification);
				exiFrag->Notification_isUsed = 1u;
				break;
			case 128:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}NotificationMaxDelay) */
				/* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeUnsignedInteger32(stream, &exiFrag->NotificationMaxDelay);
						exiFrag->NotificationMaxDelay_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 129:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}NumEPriceLevels) */
				/* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeNBitUnsignedInteger(stream, 8, &(uint32));
						exiFrag->NumEPriceLevels = (uint8_t)(uint32 + 0);
						exiFrag->NumEPriceLevels_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 130:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}OEMProvisioningCert) */
				/* FirstStartTag[CHARACTERS[BINARY_BASE64]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeUnsignedInteger16(stream, &exiFrag->OEMProvisioningCert.bytesLen);
						if (errn == 0) {
							errn =  (exiFrag->OEMProvisioningCert.bytesLen) <= dinEXIFragment_OEMProvisioningCert_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
						}
						if (errn == 0) {
							errn = decodeBytes(stream, exiFrag->OEMProvisioningCert.bytesLen, exiFrag->OEMProvisioningCert.bytes);
						}
						exiFrag->OEMProvisioningCert_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 131:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Object) */
				errn = decode_dinObjectType(stream, &exiFrag->Object);
				exiFrag->Object_isUsed = 1u;
				break;
			case 132:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}P) */
				/* FirstStartTag[CHARACTERS[BINARY_BASE64]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeUnsignedInteger16(stream, &exiFrag->P.bytesLen);
						if (errn == 0) {
							errn =  (exiFrag->P.bytesLen) <= dinEXIFragment_P_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
						}
						if (errn == 0) {
							errn = decodeBytes(stream, exiFrag->P.bytesLen, exiFrag->P.bytes);
						}
						exiFrag->P_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 133:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPData) */
				errn = decode_dinPGPDataType(stream, &exiFrag->PGPData);
				exiFrag->PGPData_isUsed = 1u;
				break;
			case 134:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyID) */
				/* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeUnsignedInteger16(stream, &exiFrag->PGPKeyID.bytesLen);
						if (errn == 0) {
							errn =  (exiFrag->PGPKeyID.bytesLen) <= dinEXIFragment_PGPKeyID_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
						}
						if (errn == 0) {
							errn = decodeBytes(stream, exiFrag->PGPKeyID.bytesLen, exiFrag->PGPKeyID.bytes);
						}
						exiFrag->PGPKeyID_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 135:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PGPKeyPacket) */
				/* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeUnsignedInteger16(stream, &exiFrag->PGPKeyPacket.bytesLen);
						if (errn == 0) {
							errn =  (exiFrag->PGPKeyPacket.bytesLen) <= dinEXIFragment_PGPKeyPacket_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
						}
						if (errn == 0) {
							errn = decodeBytes(stream, exiFrag->PGPKeyPacket.bytesLen, exiFrag->PGPKeyPacket.bytes);
						}
						exiFrag->PGPKeyPacket_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 136:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMax) */
				/* FirstStartTag[CHARACTERS[INTEGER]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeInteger16(stream, &exiFrag->PMax);
						exiFrag->PMax_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 137:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMaxSchedule) */
				errn = decode_dinPMaxScheduleType(stream, &exiFrag->PMaxSchedule);
				exiFrag->PMaxSchedule_isUsed = 1u;
				break;
			case 138:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMaxScheduleEntry) */
				errn = decode_dinPMaxScheduleEntryType(stream, &exiFrag->PMaxScheduleEntry);
				exiFrag->PMaxScheduleEntry_isUsed = 1u;
				break;
			case 139:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PMaxScheduleID) */
				/* FirstStartTag[CHARACTERS[INTEGER]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeInteger16(stream, &exiFrag->PMaxScheduleID);
						exiFrag->PMaxScheduleID_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 140:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Parameter) */
				errn = decode_dinParameterType(stream, &exiFrag->Parameter);
				exiFrag->Parameter_isUsed = 1u;
				break;
			case 141:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ParameterSet) */
				errn = decode_dinParameterSetType(stream, &exiFrag->ParameterSet);
				exiFrag->ParameterSet_isUsed = 1u;
				break;
			case 142:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ParameterSetID) */
				/* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeInteger16(stream, &exiFrag->ParameterSetID);
						exiFrag->ParameterSetID_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 143:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PaymentDetailsReq) */
				errn = decode_dinPaymentDetailsReqType(stream, &exiFrag->PaymentDetailsReq);
				exiFrag->PaymentDetailsReq_isUsed = 1u;
				break;
			case 144:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PaymentDetailsRes) */
				errn = decode_dinPaymentDetailsResType(stream, &exiFrag->PaymentDetailsRes);
				exiFrag->PaymentDetailsRes_isUsed = 1u;
				break;
			case 145:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PaymentOption) */
				/* FirstStartTag[CHARACTERS[ENUMERATION]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeNBitUnsignedInteger(stream, 1, &uint32);
						exiFrag->PaymentOption = (dinpaymentOptionType) uint32;
						exiFrag->PaymentOption_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 146:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PaymentOptions) */
				errn = decode_dinPaymentOptionsType(stream, &exiFrag->PaymentOptions);
				exiFrag->PaymentOptions_isUsed = 1u;
				break;
			case 147:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}PgenCounter) */
				/* FirstStartTag[CHARACTERS[BINARY_BASE64]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeUnsignedInteger16(stream, &exiFrag->PgenCounter.bytesLen);
						if (errn == 0) {
							errn =  (exiFrag->PgenCounter.bytesLen) <= dinEXIFragment_PgenCounter_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
						}
						if (errn == 0) {
							errn = decodeBytes(stream, exiFrag->PgenCounter.bytesLen, exiFrag->PgenCounter.bytes);
						}
						exiFrag->PgenCounter_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 148:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PowerDeliveryReq) */
				errn = decode_dinPowerDeliveryReqType(stream, &exiFrag->PowerDeliveryReq);
				exiFrag->PowerDeliveryReq_isUsed = 1u;
				break;
			case 149:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PowerDeliveryRes) */
				errn = decode_dinPowerDeliveryResType(stream, &exiFrag->PowerDeliveryRes);
				exiFrag->PowerDeliveryRes_isUsed = 1u;
				break;
			case 150:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}PowerSwitchClosed) */
				/* FirstStartTag[CHARACTERS[BOOLEAN]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeBoolean(stream, &exiFrag->PowerSwitchClosed);
						exiFrag->PowerSwitchClosed_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 151:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PreChargeReq) */
				errn = decode_dinPreChargeReqType(stream, &exiFrag->PreChargeReq);
				exiFrag->PreChargeReq_isUsed = 1u;
				break;
			case 152:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}PreChargeRes) */
				errn = decode_dinPreChargeResType(stream, &exiFrag->PreChargeRes);
				exiFrag->PreChargeRes_isUsed = 1u;
				break;
			case 153:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ProfileEntry) */
				errn = decode_dinProfileEntryType(stream, &exiFrag->ProfileEntry);
				exiFrag->ProfileEntry_isUsed = 1u;
				break;
			case 154:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Q) */
				/* FirstStartTag[CHARACTERS[BINARY_BASE64]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeUnsignedInteger16(stream, &exiFrag->Q.bytesLen);
						if (errn == 0) {
							errn =  (exiFrag->Q.bytesLen) <= dinEXIFragment_Q_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
						}
						if (errn == 0) {
							errn = decodeBytes(stream, exiFrag->Q.bytesLen, exiFrag->Q.bytes);
						}
						exiFrag->Q_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 155:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RCD) */
				/* FirstStartTag[CHARACTERS[BOOLEAN]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeBoolean(stream, &exiFrag->RCD);
						exiFrag->RCD_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 156:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RSAKeyValue) */
				errn = decode_dinRSAKeyValueType(stream, &exiFrag->RSAKeyValue);
				exiFrag->RSAKeyValue_isUsed = 1u;
				break;
			case 157:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReadyToChargeState) */
				/* FirstStartTag[CHARACTERS[BOOLEAN]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeBoolean(stream, &exiFrag->ReadyToChargeState);
						exiFrag->ReadyToChargeState_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 158:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ReceiptRequired) */
				/* FirstStartTag[CHARACTERS[BOOLEAN]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeBoolean(stream, &exiFrag->ReceiptRequired);
						exiFrag->ReceiptRequired_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 159:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Reference) */
				errn = decode_dinReferenceType(stream, &exiFrag->Reference);
				exiFrag->Reference_isUsed = 1u;
				break;
			case 160:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RelativeTimeInterval) */
				errn = decode_dinRelativeTimeIntervalType(stream, &exiFrag->RelativeTimeInterval);
				exiFrag->RelativeTimeInterval_isUsed = 1u;
				break;
			case 161:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}RemainingTimeToBulkSoC) */
				errn = decode_dinPhysicalValueType(stream, &exiFrag->RemainingTimeToBulkSoC);
				exiFrag->RemainingTimeToBulkSoC_isUsed = 1u;
				break;
			case 162:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}RemainingTimeToFullSoC) */
				errn = decode_dinPhysicalValueType(stream, &exiFrag->RemainingTimeToFullSoC);
				exiFrag->RemainingTimeToFullSoC_isUsed = 1u;
				break;
			case 163:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ResponseCode) */
				/* FirstStartTag[CHARACTERS[ENUMERATION]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeNBitUnsignedInteger(stream, 5, &uint32);
						exiFrag->ResponseCode = (dinresponseCodeType) uint32;
						exiFrag->ResponseCode_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 164:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}RetrievalMethod) */
				errn = decode_dinRetrievalMethodType(stream, &exiFrag->RetrievalMethod);
				exiFrag->RetrievalMethod_isUsed = 1u;
				break;
			case 165:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}RetryCounter) */
				/* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeInteger16(stream, &exiFrag->RetryCounter);
						exiFrag->RetryCounter_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 166:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}RootCertificateID) */
				/* FirstStartTag[CHARACTERS[STRING]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeUnsignedInteger16(stream, &exiFrag->RootCertificateID.charactersLen);
						if (errn == 0) {
							if (exiFrag->RootCertificateID.charactersLen >= 2) {
								exiFrag->RootCertificateID.charactersLen = (uint16_t)(exiFrag->RootCertificateID.charactersLen - 2); /* string table miss */
								errn = decodeCharacters(stream, exiFrag->RootCertificateID.charactersLen, exiFrag->RootCertificateID.characters, dinEXIFragment_RootCertificateID_CHARACTERS_SIZE);
							} else {
								/* string table hit */
								errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
							}
						}
						exiFrag->RootCertificateID_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 167:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleList) */
				errn = decode_dinSAScheduleListType(stream, &exiFrag->SAScheduleList);
				exiFrag->SAScheduleList_isUsed = 1u;
				break;
			case 168:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleTuple) */
				errn = decode_dinSAScheduleTupleType(stream, &exiFrag->SAScheduleTuple);
				exiFrag->SAScheduleTuple_isUsed = 1u;
				break;
			case 169:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SAScheduleTupleID) */
				/* FirstStartTag[CHARACTERS[INTEGER]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeInteger16(stream, &exiFrag->SAScheduleTupleID);
						exiFrag->SAScheduleTupleID_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 170:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SAScheduleTupleID) */
				/* FirstStartTag[CHARACTERS[INTEGER]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeInteger16(stream, &exiFrag->SAScheduleTupleID);
						exiFrag->SAScheduleTupleID_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 171:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SASchedules) */
				errn = decode_dinSASchedulesType(stream, &exiFrag->SASchedules);
				exiFrag->SASchedules_isUsed = 1u;
				break;
			case 172:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKIData) */
				errn = decode_dinSPKIDataType(stream, &exiFrag->SPKIData);
				exiFrag->SPKIData_isUsed = 1u;
				break;
			case 173:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SPKISexp) */
				/* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeUnsignedInteger16(stream, &exiFrag->SPKISexp.bytesLen);
						if (errn == 0) {
							errn =  (exiFrag->SPKISexp.bytesLen) <= dinEXIFragment_SPKISexp_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
						}
						if (errn == 0) {
							errn = decodeBytes(stream, exiFrag->SPKISexp.bytesLen, exiFrag->SPKISexp.bytes);
						}
						exiFrag->SPKISexp_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 174:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariff) */
				errn = decode_dinSalesTariffType(stream, &exiFrag->SalesTariff);
				exiFrag->SalesTariff_isUsed = 1u;
				break;
			case 175:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffDescription) */
				/* FirstStartTag[CHARACTERS[STRING]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeUnsignedInteger16(stream, &exiFrag->SalesTariffDescription.charactersLen);
						if (errn == 0) {
							if (exiFrag->SalesTariffDescription.charactersLen >= 2) {
								exiFrag->SalesTariffDescription.charactersLen = (uint16_t)(exiFrag->SalesTariffDescription.charactersLen - 2); /* string table miss */
								errn = decodeCharacters(stream, exiFrag->SalesTariffDescription.charactersLen, exiFrag->SalesTariffDescription.characters, dinEXIFragment_SalesTariffDescription_CHARACTERS_SIZE);
							} else {
								/* string table hit */
								errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
							}
						}
						exiFrag->SalesTariffDescription_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 176:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffEntry) */
				errn = decode_dinSalesTariffEntryType(stream, &exiFrag->SalesTariffEntry);
				exiFrag->SalesTariffEntry_isUsed = 1u;
				break;
			case 177:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SalesTariffID) */
				/* FirstStartTag[CHARACTERS[INTEGER]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeInteger16(stream, &exiFrag->SalesTariffID);
						exiFrag->SalesTariffID_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 178:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Seed) */
				/* FirstStartTag[CHARACTERS[BINARY_BASE64]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeUnsignedInteger16(stream, &exiFrag->Seed.bytesLen);
						if (errn == 0) {
							errn =  (exiFrag->Seed.bytesLen) <= dinEXIFragment_Seed_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
						}
						if (errn == 0) {
							errn = decodeBytes(stream, exiFrag->Seed.bytesLen, exiFrag->Seed.bytes);
						}
						exiFrag->Seed_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 179:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SelectedPaymentOption) */
				/* FirstStartTag[CHARACTERS[ENUMERATION]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeNBitUnsignedInteger(stream, 1, &uint32);
						exiFrag->SelectedPaymentOption = (dinpaymentOptionType) uint32;
						exiFrag->SelectedPaymentOption_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 180:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SelectedService) */
				errn = decode_dinSelectedServiceType(stream, &exiFrag->SelectedService);
				exiFrag->SelectedService_isUsed = 1u;
				break;
			case 181:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SelectedServiceList) */
				errn = decode_dinSelectedServiceListType(stream, &exiFrag->SelectedServiceList);
				exiFrag->SelectedServiceList_isUsed = 1u;
				break;
			case 182:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Service) */
				errn = decode_dinServiceType(stream, &exiFrag->Service);
				exiFrag->Service_isUsed = 1u;
				break;
			case 183:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceCategory) */
				/* FirstStartTag[CHARACTERS[ENUMERATION]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeNBitUnsignedInteger(stream, 2, &uint32);
						exiFrag->ServiceCategory = (dinserviceCategoryType) uint32;
						exiFrag->ServiceCategory_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 184:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceCategory) */
				/* FirstStartTag[CHARACTERS[ENUMERATION]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeNBitUnsignedInteger(stream, 2, &uint32);
						exiFrag->ServiceCategory = (dinserviceCategoryType) uint32;
						exiFrag->ServiceCategory_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 185:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceCharge) */
				errn = decode_dinServiceChargeType(stream, &exiFrag->ServiceCharge);
				exiFrag->ServiceCharge_isUsed = 1u;
				break;
			case 186:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDetailReq) */
				errn = decode_dinServiceDetailReqType(stream, &exiFrag->ServiceDetailReq);
				exiFrag->ServiceDetailReq_isUsed = 1u;
				break;
			case 187:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDetailRes) */
				errn = decode_dinServiceDetailResType(stream, &exiFrag->ServiceDetailRes);
				exiFrag->ServiceDetailRes_isUsed = 1u;
				break;
			case 188:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDiscoveryReq) */
				errn = decode_dinServiceDiscoveryReqType(stream, &exiFrag->ServiceDiscoveryReq);
				exiFrag->ServiceDiscoveryReq_isUsed = 1u;
				break;
			case 189:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceDiscoveryRes) */
				errn = decode_dinServiceDiscoveryResType(stream, &exiFrag->ServiceDiscoveryRes);
				exiFrag->ServiceDiscoveryRes_isUsed = 1u;
				break;
			case 190:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceID) */
				/* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeUnsignedInteger16(stream, &exiFrag->ServiceID);
						exiFrag->ServiceID_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 191:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceID) */
				/* FirstStartTag[CHARACTERS[UNSIGNED_INTEGER]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeUnsignedInteger16(stream, &exiFrag->ServiceID);
						exiFrag->ServiceID_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 192:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceList) */
				errn = decode_dinServiceTagListType(stream, &exiFrag->ServiceList);
				exiFrag->ServiceList_isUsed = 1u;
				break;
			case 193:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceName) */
				/* FirstStartTag[CHARACTERS[STRING]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeUnsignedInteger16(stream, &exiFrag->ServiceName.charactersLen);
						if (errn == 0) {
							if (exiFrag->ServiceName.charactersLen >= 2) {
								exiFrag->ServiceName.charactersLen = (uint16_t)(exiFrag->ServiceName.charactersLen - 2); /* string table miss */
								errn = decodeCharacters(stream, exiFrag->ServiceName.charactersLen, exiFrag->ServiceName.characters, dinEXIFragment_ServiceName_CHARACTERS_SIZE);
							} else {
								/* string table hit */
								errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
							}
						}
						exiFrag->ServiceName_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 194:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceParameterList) */
				errn = decode_dinServiceParameterListType(stream, &exiFrag->ServiceParameterList);
				exiFrag->ServiceParameterList_isUsed = 1u;
				break;
			case 195:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServicePaymentSelectionReq) */
				errn = decode_dinServicePaymentSelectionReqType(stream, &exiFrag->ServicePaymentSelectionReq);
				exiFrag->ServicePaymentSelectionReq_isUsed = 1u;
				break;
			case 196:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServicePaymentSelectionRes) */
				errn = decode_dinServicePaymentSelectionResType(stream, &exiFrag->ServicePaymentSelectionRes);
				exiFrag->ServicePaymentSelectionRes_isUsed = 1u;
				break;
			case 197:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}ServiceScope) */
				/* FirstStartTag[CHARACTERS[STRING]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeUnsignedInteger16(stream, &exiFrag->ServiceScope.charactersLen);
						if (errn == 0) {
							if (exiFrag->ServiceScope.charactersLen >= 2) {
								exiFrag->ServiceScope.charactersLen = (uint16_t)(exiFrag->ServiceScope.charactersLen - 2); /* string table miss */
								errn = decodeCharacters(stream, exiFrag->ServiceScope.charactersLen, exiFrag->ServiceScope.characters, dinEXIFragment_ServiceScope_CHARACTERS_SIZE);
							} else {
								/* string table hit */
								errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
							}
						}
						exiFrag->ServiceScope_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 198:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceScope) */
				/* FirstStartTag[CHARACTERS[STRING]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeUnsignedInteger16(stream, &exiFrag->ServiceScope.charactersLen);
						if (errn == 0) {
							if (exiFrag->ServiceScope.charactersLen >= 2) {
								exiFrag->ServiceScope.charactersLen = (uint16_t)(exiFrag->ServiceScope.charactersLen - 2); /* string table miss */
								errn = decodeCharacters(stream, exiFrag->ServiceScope.charactersLen, exiFrag->ServiceScope.characters, dinEXIFragment_ServiceScope_CHARACTERS_SIZE);
							} else {
								/* string table hit */
								errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
							}
						}
						exiFrag->ServiceScope_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 199:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}ServiceTag) */
				errn = decode_dinServiceTagType(stream, &exiFrag->ServiceTag);
				exiFrag->ServiceTag_isUsed = 1u;
				break;
			case 200:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionID) */
				/* FirstStartTag[CHARACTERS[BINARY_HEX]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeUnsignedInteger16(stream, &exiFrag->SessionID.bytesLen);
						if (errn == 0) {
							errn =  (exiFrag->SessionID.bytesLen) <= dinEXIFragment_SessionID_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
						}
						if (errn == 0) {
							errn = decodeBytes(stream, exiFrag->SessionID.bytesLen, exiFrag->SessionID.bytes);
						}
						exiFrag->SessionID_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 201:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgHeader}SessionID) */
				/* FirstStartTag[CHARACTERS[BINARY_HEX]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeUnsignedInteger16(stream, &exiFrag->SessionID.bytesLen);
						if (errn == 0) {
							errn =  (exiFrag->SessionID.bytesLen) <= dinEXIFragment_SessionID_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
						}
						if (errn == 0) {
							errn = decodeBytes(stream, exiFrag->SessionID.bytesLen, exiFrag->SessionID.bytes);
						}
						exiFrag->SessionID_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 202:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionSetupReq) */
				errn = decode_dinSessionSetupReqType(stream, &exiFrag->SessionSetupReq);
				exiFrag->SessionSetupReq_isUsed = 1u;
				break;
			case 203:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionSetupRes) */
				errn = decode_dinSessionSetupResType(stream, &exiFrag->SessionSetupRes);
				exiFrag->SessionSetupRes_isUsed = 1u;
				break;
			case 204:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionStopReq) */
				errn = decode_dinSessionStopType(stream, &exiFrag->SessionStopReq);
				exiFrag->SessionStopReq_isUsed = 1u;
				break;
			case 205:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}SessionStopRes) */
				errn = decode_dinSessionStopResType(stream, &exiFrag->SessionStopRes);
				exiFrag->SessionStopRes_isUsed = 1u;
				break;
			case 206:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SigMeterReading) */
				/* FirstStartTag[CHARACTERS[BINARY_BASE64]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeUnsignedInteger16(stream, &exiFrag->SigMeterReading.bytesLen);
						if (errn == 0) {
							errn =  (exiFrag->SigMeterReading.bytesLen) <= dinEXIFragment_SigMeterReading_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
						}
						if (errn == 0) {
							errn = decodeBytes(stream, exiFrag->SigMeterReading.bytesLen, exiFrag->SigMeterReading.bytes);
						}
						exiFrag->SigMeterReading_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 207:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Signature) */
				errn = decode_dinSignatureType(stream, &exiFrag->Signature);
				exiFrag->Signature_isUsed = 1u;
				break;
			case 208:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureMethod) */
				errn = decode_dinSignatureMethodType(stream, &exiFrag->SignatureMethod);
				exiFrag->SignatureMethod_isUsed = 1u;
				break;
			case 209:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperties) */
				errn = decode_dinSignaturePropertiesType(stream, &exiFrag->SignatureProperties);
				exiFrag->SignatureProperties_isUsed = 1u;
				break;
			case 210:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureProperty) */
				errn = decode_dinSignaturePropertyType(stream, &exiFrag->SignatureProperty);
				exiFrag->SignatureProperty_isUsed = 1u;
				break;
			case 211:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignatureValue) */
				errn = decode_dinSignatureValueType(stream, &exiFrag->SignatureValue);
				exiFrag->SignatureValue_isUsed = 1u;
				break;
			case 212:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}SignedInfo) */
				errn = decode_dinSignedInfoType(stream, &exiFrag->SignedInfo);
				exiFrag->SignedInfo_isUsed = 1u;
				break;
			case 213:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}SubCertificates) */
				errn = decode_dinSubCertificatesType(stream, &exiFrag->SubCertificates);
				exiFrag->SubCertificates_isUsed = 1u;
				break;
			case 214:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TMeter) */
				/* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeInteger64(stream, &exiFrag->TMeter);
						exiFrag->TMeter_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 215:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}TimeInterval) */
				errn = decode_dinIntervalType(stream, &exiFrag->TimeInterval);
				exiFrag->TimeInterval_isUsed = 1u;
				break;
			case 216:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transform) */
				errn = decode_dinTransformType(stream, &exiFrag->Transform);
				exiFrag->Transform_isUsed = 1u;
				break;
			case 217:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Transforms) */
				errn = decode_dinTransformsType(stream, &exiFrag->Transforms);
				exiFrag->Transforms_isUsed = 1u;
				break;
			case 218:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Unit) */
				/* FirstStartTag[CHARACTERS[ENUMERATION]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeNBitUnsignedInteger(stream, 4, &uint32);
						exiFrag->Unit = (dinunitSymbolType) uint32;
						exiFrag->Unit_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 219:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDef}V2G_Message) */
				errn = decode_dinAnonType_V2G_Message(stream, &exiFrag->V2G_Message);
				exiFrag->V2G_Message_isUsed = 1u;
				break;
			case 220:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}Value) */
				/* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeInteger16(stream, &exiFrag->Value);
						exiFrag->Value_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 221:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}WeldingDetectionReq) */
				errn = decode_dinWeldingDetectionReqType(stream, &exiFrag->WeldingDetectionReq);
				exiFrag->WeldingDetectionReq_isUsed = 1u;
				break;
			case 222:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgBody}WeldingDetectionRes) */
				errn = decode_dinWeldingDetectionResType(stream, &exiFrag->WeldingDetectionRes);
				exiFrag->WeldingDetectionRes_isUsed = 1u;
				break;
			case 223:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509CRL) */
				/* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeUnsignedInteger16(stream, &exiFrag->X509CRL.bytesLen);
						if (errn == 0) {
							errn =  (exiFrag->X509CRL.bytesLen) <= dinEXIFragment_X509CRL_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
						}
						if (errn == 0) {
							errn = decodeBytes(stream, exiFrag->X509CRL.bytesLen, exiFrag->X509CRL.bytes);
						}
						exiFrag->X509CRL_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 224:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Certificate) */
				/* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeUnsignedInteger16(stream, &exiFrag->X509Certificate.bytesLen);
						if (errn == 0) {
							errn =  (exiFrag->X509Certificate.bytesLen) <= dinEXIFragment_X509Certificate_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
						}
						if (errn == 0) {
							errn = decodeBytes(stream, exiFrag->X509Certificate.bytesLen, exiFrag->X509Certificate.bytes);
						}
						exiFrag->X509Certificate_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 225:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509Data) */
				errn = decode_dinX509DataType(stream, &exiFrag->X509Data);
				exiFrag->X509Data_isUsed = 1u;
				break;
			case 226:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerName) */
				/* First(xsi:type)StartTag[CHARACTERS[STRING]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeUnsignedInteger16(stream, &exiFrag->X509IssuerName.charactersLen);
						if (errn == 0) {
							if (exiFrag->X509IssuerName.charactersLen >= 2) {
								exiFrag->X509IssuerName.charactersLen = (uint16_t)(exiFrag->X509IssuerName.charactersLen - 2); /* string table miss */
								errn = decodeCharacters(stream, exiFrag->X509IssuerName.charactersLen, exiFrag->X509IssuerName.characters, dinEXIFragment_X509IssuerName_CHARACTERS_SIZE);
							} else {
								/* string table hit */
								errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
							}
						}
						exiFrag->X509IssuerName_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 227:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509IssuerSerial) */
				errn = decode_dinX509IssuerSerialType(stream, &exiFrag->X509IssuerSerial);
				exiFrag->X509IssuerSerial_isUsed = 1u;
				break;
			case 228:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SKI) */
				/* First(xsi:type)StartTag[CHARACTERS[BINARY_BASE64]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeUnsignedInteger16(stream, &exiFrag->X509SKI.bytesLen);
						if (errn == 0) {
							errn =  (exiFrag->X509SKI.bytesLen) <= dinEXIFragment_X509SKI_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
						}
						if (errn == 0) {
							errn = decodeBytes(stream, exiFrag->X509SKI.bytesLen, exiFrag->X509SKI.bytes);
						}
						exiFrag->X509SKI_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 229:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SerialNumber) */
				/* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeInteger64(stream, &exiFrag->X509SerialNumber);
						exiFrag->X509SerialNumber_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 230:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}X509SubjectName) */
				/* First(xsi:type)StartTag[CHARACTERS[STRING]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeUnsignedInteger16(stream, &exiFrag->X509SubjectName.charactersLen);
						if (errn == 0) {
							if (exiFrag->X509SubjectName.charactersLen >= 2) {
								exiFrag->X509SubjectName.charactersLen = (uint16_t)(exiFrag->X509SubjectName.charactersLen - 2); /* string table miss */
								errn = decodeCharacters(stream, exiFrag->X509SubjectName.charactersLen, exiFrag->X509SubjectName.characters, dinEXIFragment_X509SubjectName_CHARACTERS_SIZE);
							} else {
								/* string table hit */
								errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
							}
						}
						exiFrag->X509SubjectName_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 231:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}XPath) */
				/* First(xsi:type)StartTag[CHARACTERS[STRING]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeUnsignedInteger16(stream, &exiFrag->XPath.charactersLen);
						if (errn == 0) {
							if (exiFrag->XPath.charactersLen >= 2) {
								exiFrag->XPath.charactersLen = (uint16_t)(exiFrag->XPath.charactersLen - 2); /* string table miss */
								errn = decodeCharacters(stream, exiFrag->XPath.charactersLen, exiFrag->XPath.characters, dinEXIFragment_XPath_CHARACTERS_SIZE);
							} else {
								/* string table hit */
								errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
							}
						}
						exiFrag->XPath_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 232:
				/* START_ELEMENT({http://www.w3.org/2000/09/xmldsig#}Y) */
				/* FirstStartTag[CHARACTERS[BINARY_BASE64]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeUnsignedInteger16(stream, &exiFrag->Y.bytesLen);
						if (errn == 0) {
							errn =  (exiFrag->Y.bytesLen) <= dinEXIFragment_Y_BYTES_SIZE ? 0 : EXI_ERROR_OUT_OF_BYTE_BUFFER;
						}
						if (errn == 0) {
							errn = decodeBytes(stream, exiFrag->Y.bytesLen, exiFrag->Y.bytes);
						}
						exiFrag->Y_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 233:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}amount) */
				/* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeUnsignedInteger32(stream, &exiFrag->amount);
						exiFrag->amount_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 234:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}amountMultiplier) */
				/* FirstStartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeNBitUnsignedInteger(stream, 3, &(uint32));
						exiFrag->amountMultiplier = (int8_t)(uint32 -3);
						exiFrag->amountMultiplier_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 235:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}boolValue) */
				/* FirstStartTag[CHARACTERS[BOOLEAN]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeBoolean(stream, &exiFrag->boolValue);
						exiFrag->boolValue_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 236:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}byteValue) */
				/* First(xsi:type)StartTag[CHARACTERS[NBIT_UNSIGNED_INTEGER]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeNBitUnsignedInteger(stream, 8, &(uint32));
						exiFrag->byteValue = (int8_t)(uint32 -128);
						exiFrag->byteValue_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 237:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}costKind) */
				/* FirstStartTag[CHARACTERS[ENUMERATION]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeNBitUnsignedInteger(stream, 2, &uint32);
						exiFrag->costKind = (dincostKindType) uint32;
						exiFrag->costKind_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 238:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}duration) */
				/* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeUnsignedInteger32(stream, &exiFrag->duration);
						exiFrag->duration_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 239:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}intValue) */
				/* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeInteger32(stream, &exiFrag->intValue);
						exiFrag->intValue_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 240:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}physicalValue) */
				errn = decode_dinPhysicalValueType(stream, &exiFrag->physicalValue);
				exiFrag->physicalValue_isUsed = 1u;
				break;
			case 241:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}shortValue) */
				/* First(xsi:type)StartTag[CHARACTERS[INTEGER]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeInteger16(stream, &exiFrag->shortValue);
						exiFrag->shortValue_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 242:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}start) */
				/* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeUnsignedInteger32(stream, &exiFrag->start);
						exiFrag->start_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 243:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}startValue) */
				/* First(xsi:type)StartTag[CHARACTERS[UNSIGNED_INTEGER]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeUnsignedInteger32(stream, &exiFrag->startValue);
						exiFrag->startValue_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			case 244:
				/* START_ELEMENT({urn:iso:15118:2:2010:MsgDataTypes}stringValue) */
				/* First(xsi:type)StartTag[CHARACTERS[STRING]] */
				errn = decodeNBitUnsignedInteger(stream, 1, &eventCode);
				if(errn == 0) {
					if(eventCode == 0) {
						errn = decodeUnsignedInteger16(stream, &exiFrag->stringValue.charactersLen);
						if (errn == 0) {
							if (exiFrag->stringValue.charactersLen >= 2) {
								exiFrag->stringValue.charactersLen = (uint16_t)(exiFrag->stringValue.charactersLen - 2); /* string table miss */
								errn = decodeCharacters(stream, exiFrag->stringValue.charactersLen, exiFrag->stringValue.characters, dinEXIFragment_stringValue_CHARACTERS_SIZE);
							} else {
								/* string table hit */
								errn = EXI_ERROR_STRINGVALUES_NOT_SUPPORTED;
							}
						}
						exiFrag->stringValue_isUsed = 1u;
					} else {
						/* Second level event (e.g., xsi:type, xsi:nil, ...) */
						errn = EXI_UNSUPPORTED_EVENT_CODE_CHARACTERISTICS;
					}
				}
				break;
			default:
				errn = EXI_ERROR_UNEXPECTED_EVENT_LEVEL1;
				break;
			}
		}
		if(errn == 0) {
			/* EndDocument */
			errn = decodeNBitUnsignedInteger(stream, 8, &eventCode);
			if (eventCode != 246) {
				errn = EXI_UNSUPPORTED_FRAGMENT_ELEMENT;
			}
		}

	}

	(void)exiFrag; /* avoid unused warning */

	return errn;
}
#endif /* DEPLOY_DIN_CODEC_FRAGMENT */


#endif /* DEPLOY_DIN_CODEC */

#endif

